Skip to content

Conversation

@jmagman
Copy link
Member

@jmagman jmagman commented Jan 19, 2022

Help debugging issues like #96401 by taking a screenshot of the device during drive when the app fails to start, or testing otherwise fails.

drive --screenshot introduced in #78822.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@jmagman jmagman self-assigned this Jan 19, 2022
@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jan 19, 2022
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of this patch is whitespace changes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This catch is the new part.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a DriveCommand to test instead of calling directly from tests.

@jmagman jmagman requested a review from zanderso January 19, 2022 19:52
);
if (testResult != 0 && screenshot != null) {
await takeScreenshot(device, screenshot, _fileSystem, _logger, _fsUtils);
if (boolArg('keep-app-running') ?? (argResults['use-existing-app'] != null)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the code here between 292 and 302 throws, you could get two screenshots, one from the call on 289 and another from the one in the catch. Is that intentional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. Worse, if testResult fails which would happen often enough, it will take two screenshots, one from line 289, then another on catching the toolExit. Let me fix that up.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Also added a test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, the screenshot should be taken after the drive test failure but before the app is stopped. Created #96973 to reinstate this behavior.

@fluttergithubbot fluttergithubbot merged commit ef8a841 into flutter:master Jan 20, 2022
@jmagman jmagman deleted the drive-screenshot branch January 20, 2022 06:27
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 4, 2022
@jmagman jmagman added team: flakes a: tests "flutter test", flutter_test, or one of our tests labels Feb 18, 2022
clocksmith pushed a commit to clocksmith/flutter that referenced this pull request Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: tests "flutter test", flutter_test, or one of our tests tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants