-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Update android_device.dart to have clearLogs not print to standard error #150197
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
Update android_device.dart to have clearLogs not print to standard error #150197
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
| if (result.exitCode != 0) { | ||
| _logger.printTrace('"adb logcat -c" failed: exitCode: ${result.exitCode}' | ||
| ' stdout: ${result.stdout} stderr: ${result.stderr}'); | ||
| } |
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.
I'm afraid I've sent you down the wrong path; after digging through PorcessUtils; it shouldn't fail. RunResult is basically after the fact. The "Task failed:" string in the logs only shows up here:
./dev/devicelab/lib/framework/framework.dart:280: final String message = 'Task failed: $taskError';
The "Executable" part of the string looks like its from:
./dev/devicelab/lib/framework/utils.dart:383: fail('Executable "$executable" failed with exit code $exitCode.');
if I change the way I search; there is another logcat:
flutter/dev/devicelab/lib/framework/devices.dart
Lines 736 to 739 in 034966b
| Future<void> startLoggingToSink(IOSink sink, {bool clear = true}) async { | |
| if (clear) { | |
| await adb(<String>['logcat', '--clear'], silent: true); | |
| } |
Future<void> startLoggingToSink(IOSink sink, {bool clear = true}) async {
if (clear) {
await adb(<String>['logcat', '--clear'], silent: true);
}adb here calls eval in utils with canFail=false. I believe this is the route taken to fail the test and we can just use canFail=true.
Thoughts?
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.
We would need to modify adb to take a can fail boolean since most adb commands have to work. Only here an a few other cases would canFail be true.
Roll Flutter from 6c06abb to e726eb4 (51 revisions) flutter/flutter@6c06abb...e726eb4 2024-06-25 [email protected] Roll Packages from 711b4ac to 03f5f6d (21 revisions) (flutter/flutter#150779) 2024-06-25 [email protected] Roll Flutter Engine from afa7ce19bca8 to fbd92055f3a6 (1 revision) (flutter/flutter#150777) 2024-06-25 [email protected] Reland Add tests for form_text_field.1.dart (#150481) (#150696) (flutter/flutter#150750) 2024-06-25 [email protected] Add an example for CupertinoPopupSurface (flutter/flutter#150357) 2024-06-25 [email protected] [flutter_tools/dap] Handle app.stop errors when launching/attaching (flutter/flutter#149734) 2024-06-25 [email protected] Roll Flutter Engine from be7db94196fe to afa7ce19bca8 (18 revisions) (flutter/flutter#150762) 2024-06-25 [email protected] Remove dubious comment (flutter/flutter#150608) 2024-06-25 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Manual engine roll to 6884e83 (#150733)" (flutter/flutter#150746) 2024-06-25 [email protected] Manual engine roll to 6884e83 (flutter/flutter#150733) 2024-06-24 [email protected] Linkify 'see also' sections (flutter/flutter#150734) 2024-06-24 [email protected] Roll pub packages (flutter/flutter#150712) 2024-06-24 [email protected] Update flutter.dev links from framework to more permanent destinations (flutter/flutter#150531) 2024-06-24 [email protected] Manual engine roll to be7db94196fe (flutter/flutter#150714) 2024-06-24 [email protected] allow adb to set canfail then use canFail=true for clearing logs (flutter/flutter#150517) 2024-06-24 [email protected] Update android_device.dart to have clearLogs not print to standard error (flutter/flutter#150197) 2024-06-24 [email protected] Update issue link in analysis_options.yaml (flutter/flutter#150395) 2024-06-24 [email protected] Fix a number of broken doc comment references (flutter/flutter#150540) 2024-06-24 [email protected] Fix flaky sliver tree test (flutter/flutter#150707) 2024-06-24 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Add tests for form_text_field.1.dart (#150481)" (flutter/flutter#150696) 2024-06-24 [email protected] Add tests for form_text_field.1.dart (flutter/flutter#150481) 2024-06-22 [email protected] Fix: Memory leak in UndoHistory widget because it never de-registered itself as global UndoManager client (Resolves #148291) (flutter/flutter#150661) 2024-06-22 [email protected] [CupertinoActionSheet] Fix the layout (part 1) (flutter/flutter#149636) 2024-06-21 [email protected] Remove discontinued `device_info` and `connectivity` plugins from `flutter_gallery`, roll pub packages (flutter/flutter#150585) 2024-06-21 [email protected] [a11y] Update semantics in bottom_navigation_bar.dart (flutter/flutter#150576) 2024-06-21 [email protected] Roll Flutter Engine from dda82d905f37 to 33415c6ee7c2 (7 revisions) (flutter/flutter#150637) 2024-06-21 [email protected] Reland 4: [CupertinoActionSheet] Match colors to native (flutter/flutter#150442) 2024-06-21 [email protected] Enable SelectionArea double tap/triple tap gesture support for mobile platforms (flutter/flutter#149295) 2024-06-21 [email protected] made SelectionArea alignment consistent between web and other platform (flutter/flutter#150037) 2024-06-21 [email protected] Fix link hook typo (flutter/flutter#150194) 2024-06-21 [email protected] Stop looking for .packages when analyzing (flutter/flutter#150349) 2024-06-20 [email protected] Update flutter.dev links from misc packages to more permanent destinations (flutter/flutter#150532) 2024-06-20 [email protected] Roll Flutter Engine from dd37cefd4a94 to dda82d905f37 (9 revisions) (flutter/flutter#150582) 2024-06-20 [email protected] Update Material token to the latest 4.1.0 (flutter/flutter#150382) 2024-06-20 [email protected] Let the lockfile script generate lockfiles for kotlin gradle files as well (flutter/flutter#150471) 2024-06-20 [email protected] Make popup menu hardcoded padding configurable (flutter/flutter#150506) 2024-06-20 [email protected] [flutter_tools] un-hide the --dds flag (flutter/flutter#150280) 2024-06-20 [email protected] [material/menu_anchor.dart] Remove _MenuAnchorState from parent when disposed. (flutter/flutter#149586) 2024-06-20 [email protected] Add test for inherited_notifier.0.dart (flutter/flutter#150344) 2024-06-20 [email protected] [CLI tool] in `flutter test`, consider `--flavor` when validating the cached asset bundle (flutter/flutter#150461) 2024-06-20 [email protected] Test InputDecoration API examples (flutter/flutter#148560) 2024-06-20 [email protected] Clean leaky tests. (flutter/flutter#150335) 2024-06-20 [email protected] Roll Flutter Engine from f9c497f178d3 to dd37cefd4a94 (2 revisions) (flutter/flutter#150537) 2024-06-20 [email protected] Roll Flutter Engine from a31279381b40 to f9c497f178d3 (9 revisions) (flutter/flutter#150528) 2024-06-19 [email protected] Add tests for about_list_tile.0.dart (flutter/flutter#150181) 2024-06-19 [email protected] Roll Flutter Engine from 0ad18fe4c0b5 to a31279381b40 (7 revisions) (flutter/flutter#150473) 2024-06-18 [email protected] Revert "[a11y] Add semantics: button to bottom navigation bar items and dropdown menu items" (flutter/flutter#150445) ...
…ror (flutter#150197) Even though this does not fix the below issue lets land this anyway as not logging to stderr when clearing logs makes sense to me. related flutter#150093 The test added is bad. It does not verify the behavior changed. To verify the behavior changed correctly I would need to modify the generic device class to have clearLogs be an async function like many of the other calls. That would mean modifying every other device type and their implementations and their tests. Then I would need to update android_device to expose its logger. That is more than I have time for to validate a 2% flake error. Feel free to disagree in the comments on this pr.
Even though this does not fix the below issue lets land this anyway as not logging to stderr when clearing logs makes sense to me.
related #150093
The test added is bad. It does not verify the behavior changed.
To verify the behavior changed correctly I would need to modify the generic device class to have clearLogs be an async function like many of the other calls. That would mean modifying every other device type and their implementations and their tests. Then I would need to update android_device to expose its logger. That is more than I have time for to validate a 2% flake error.
Feel free to disagree in the comments on this pr.
Pre-launch Checklist
///).