Skip to content
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

Fix integration_test/test/live_connection/eval_and_inspect_test.dart flake #8123

Merged
merged 4 commits into from
Jul 31, 2024

Conversation

elliette
Copy link
Member

Work towards #8013

Tries to fix one of our top integration test flakes:

Actual: _TextContainingWidgetFinder:<Found 0 widgets with text
containing Variable button is created : []>
   Which: means none were found but one was expected

Evaluation is async since it requires a response from the VM service. I think this test was flaking because we were looking for the eval response in the console too soon. This PR adds and uses a test utility function (retryUntilFound) that will retry looking for a finder with a safePumpDuration in between until the found or there are no more retries.

@elliette elliette requested a review from a team as a code owner July 31, 2024 16:05
@elliette elliette requested review from bkonyi and removed request for a team July 31, 2024 16:05
final found = tester.any(finder);
if (found) return finder;

await tester.pump(safePumpDuration);
Copy link
Contributor

Choose a reason for hiding this comment

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

How long is safePumpDuration?

Copy link
Member Author

Choose a reason for hiding this comment

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

3 seconds:

const shortPumpDuration = Duration(seconds: 1);
const safePumpDuration = Duration(seconds: 3);
const longPumpDuration = Duration(seconds: 6);
const veryLongPumpDuration = Duration(seconds: 9);

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! That seems reasonable, I think.

@elliette elliette merged commit 8179fbf into flutter:master Jul 31, 2024
23 of 24 checks passed
@elliette elliette mentioned this pull request Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants