Print warning if flutter drive is run in debug#30747
Print warning if flutter drive is run in debug#30747liyuqian merged 6 commits intoflutter:masterfrom
Conversation
|
|
f133659 to
3e3f7c8
Compare
|
We should only show this for benchmarks. FWIW, here's the code for flutter_test that does the equivalent: Important things to notice:
|
This test will also make sure that the VM flags are working as intended. (Previously, `getVmFlags` is unused in our repo and will throw exception upon calling.)
|
@Hixie @jonahwilliams : how about the new version which only prints warning if |
| Future<List<Map<String, dynamic>>> getVmFlags() async { | ||
| final Map<String, dynamic> result = await _peer.sendRequest('getFlagList'); | ||
| return result['flags']; | ||
| return result != null ? result['flags'].cast<Map<String,dynamic>>() : <Map<String, dynamic>>[]; |
| @@ -788,6 +814,10 @@ class FlutterDriver { | |||
| } | |||
There was a problem hiding this comment.
update the documentation here as well
| 'Could not find the following warning message piece: $warningPiece' | ||
| ); | ||
| } | ||
| } |
There was a problem hiding this comment.
you should also test the reverse (that running with --profile doesn't show the warning).
|
Approach seems reasonable. |
Description
Print actionable warnings if
flutter drive(where most of our performance benchmarks come from) is run in debug mode and it tries to gather benchmarks usingtraceAction.Related Issues
#30625
Tests
I added the following tests:
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?