You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Refactor scrollable_semantics_test.dart to avoid shared top-level SemanticsTester #189799
packages/flutter/test/widgets/scrollable_semantics_test.dart keeps a single SemanticsTester in a top-level variable that is reused across every test in the file:
voidmain() {
lateSemanticsTester semantics;
...
}
Sharing one tester across tests is fragile. If a test doesn't dispose of it (for example, when a test fails partway through), that state can leak into the next test and produce confusing, order-dependent failures.
What to do
Refactor the file so each test owns its own SemanticsTester and disposes of it reliably. A setUp/tearDown pair, or addTearDown inside each test, both work well here. After the change there should be no shared top-level SemanticsTester.
Scope
Only packages/flutter/test/widgets/scrollable_semantics_test.dart.
Test-only change; no framework behavior changes.
All existing tests in the file should still pass.
Context
Noticed during review of #188788. It was intentionally left out of that PR to keep it focused on the fix, and tracked here for a separate follow-up.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
Scope SemanticsTester per test in scrollable_semantics_test (flutter#…
Scope SemanticsTester per test in scrollable_semantics_test (flutter#…
github-actions commentedon Aug 14, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.