feat: Lock random seeds in the flutter/tests customer testing run - #4052
Merged
Merged
Conversation
The customer testing script now passes a fixed RANDOM_SEED define to flutter test so that the run is deterministic. To make that work, the testRandom helper offsets a fixed seed by the repeat index instead of reusing it, testWidgetsRandom honors the define too, and the two tests that created an unseeded Random directly now seed it from the environment.
spydon
force-pushed
the
feat/lock-random-seeds-in-customer-testing
branch
from
September 22, 2026 07:16
56f90d7 to
5292d88
Compare
spydon
enabled auto-merge (squash)
September 22, 2026 07:19
wolfenrain
approved these changes
Sep 22, 2026
spydon
added a commit
to spydon/tests
that referenced
this pull request
Sep 22, 2026
Picks up flame-engine/flame#4051, which fixes the solveQuadratic random test tolerance that made the customer test fail for some seeds, and flame-engine/flame#4052, which pins the randomized tests to a fixed seed in the customer testing run so it stays deterministic.
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.
Description
The flutter/tests customer testing run exists to catch regressions in flutter/flutter, so it should be deterministic. Randomized tests with fresh seeds on every run (see #4051 for a recent example) can make it fail for reasons that have nothing to do with the framework change under test.
scripts/customer_testing.dartnow passes--dart-define=RANDOM_SEED=<fixed>toflutter test. TheRANDOM_SEEDdefine was already read bytestRandominflame_test, but a few things had to change for it to be usable across a whole run:testRandomoffsets a fixed seed by the repeat index, sorepeatCount: 3still runs three distinct cases instead of the same one three times. This applies to theseed:parameter as well, and the first repeat still uses the seed as given, so reproducing a failure from the test output works as before.testWidgetsRandomnow honors the define too. It previously ignored it.Random()directly (the fixed aspect ratio viewport auto-resizing test and the opacity effect fade out test) now seed it throughseedFromEnvironment, so they are deterministic under the define and unchanged otherwise.random_test_testassertion that consecutive seeds differ is skipped when the define is set, since that is exactly what the define turns off. A new test covers the repeat offset behavior.Flame's own CI keeps running the randomized tests with fresh seeds, so randomized coverage is unchanged there.
Verified locally with
flutter testinflame_testand on the affectedflametests, both with and without--dart-define=RANDOM_SEED=20260922. With the define, the test names show consecutive seeds per repeat and everything passes.Checklist
docsand added dartdoc comments with///.examplesordocs.Breaking Change?
Related Issues
Follow-up to #4051 and flutter/tests#493.