-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Print warning if flutter drive is run in debug #30747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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:
|
dnfield
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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>>[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can the fallback be const?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Done.
| }) async { | ||
| if (!retainPriorEvents) { | ||
| await clearTimeline(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update the documentation here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| 'Could not find the following warning message piece: $warningPiece' | ||
| ); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should also test the reverse (that running with --profile doesn't show the warning).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
Approach seems reasonable. |
jonahwilliams
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
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?