Repository navigation
Fix a race in an expanded reporter retry test - #2810
Merged
Merged
Conversation
The test "retry: does not report an attempt for errors after completion"
flaked on master: the expected `+1: second test ...` progress line was
missing, and the output went straight to `+0 -1: second test ...`.
The first test scheduled its error with `Future(() { ... })`, so the test
isolate raised it right after the test completed, without waiting for the
runner. The runner starts the next test one event-loop turn after it
receives the `complete` message. If the error message was already queued
by then, the first test moved to failed before the second test started,
and the reporter printed different progress lines. Both orders are correct
reporter output; the test's expectation relied on the race.
Have the second test trigger the first test's error, using the same
`Completer` pattern as `retry_test.dart`. The error can't exist until the
second test is running in the isolate, after the runner has printed its
progress line, and the second test waits a turn so the error arrives before
it completes.
Locally, the old fixture produced the CI output in 1 of 40 runs. The new
fixture produced identical output in 60 of 60 runs.
PR HealthChangelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with |
brianquinlan
approved these changes
Oct 28, 2026
copybara-service Bot
pushed a commit
to dart-lang/sdk
that referenced
this pull request
Oct 29, 2026
Revisions updated by `dart tools/rev_sdk_deps.dart test`. test (https://github.com/dart-lang/test/compare/5967927..6d74720): 6d747209 Wed Oct 28 15:12:45 2026 -0700 Nate Bosch Fix a race in an expanded reporter retry test (dart-lang/test#2810) 434cf2fc Wed Oct 28 09:06:26 2026 -0700 Nate Bosch Enable incremental migration for argument swap (dart-lang/test#2806) Change-Id: Ifcb0f113940380b788492f3fed829792ba0b7676 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/570662 Auto-Submit: Nate Bosch <[email protected]> Reviewed-by: Kevin Moore <[email protected]> Commit-Queue: Kevin Moore <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a flake in
expanded_reporter_test.dart"retry: does not report anattempt for errors after completion", added in #2801. It failed on master
in https://github.com/dart-lang/test/actions/runs/40722683531/job/122938155175:
the
+1: second test ...line was missing and the output went straight to+0 -1: second test ....The first test scheduled its error with
Future(() { ... }), so the testisolate raised it right after the test completed. The runner starts the
next test one event-loop turn after it receives the
completemessage. Ifthe error message was already queued by then, the first test moved to
failed before the second test started. Both orders are correct output, so
this changes the test rather than the runner.
The second test now triggers the first test's error, using the same
Completerpattern asretry_test.dart. Only the stack trace lines in theexpected output change.
Locally, the old fixture reproduced the CI output in 1 of 40 runs. The new
fixture produced identical output in 60 of 60 runs.