Repository navigation
Fix some latent test bugs (state leaked between tests) - #2457
Merged
Merged
Conversation
rajveermalviya
approved these changes
Sep 18, 2026
rajveermalviya
left a comment
Member
There was a problem hiding this comment.
Thanks @chrisbobbe! LGTM, please go ahead and merge.
…eWidget These two pump a widget tree containing a GlobalStoreWidget without `addTearDown(testBinding.reset)`. Each is currently the last test in its file, so nothing fails. But if someone adds a test after one of them and it mounts a GlobalStoreWidget, the store from these would still be loaded, and that test would trip TestZulipBinding.getGlobalStoreUniquely -- the assertion firing in the new test rather than in these two, making it confusing to track down. So add `addTearDown(testBinding.reset)` to both. Co-Authored-By: Claude Opus 5 <[email protected]>
The file-scope `testNavObserver` writes into `late` locals that only `prepare` initializes, so a test pumping the tree via `prepareBanner` would hit an uninitialized `pushedRoutes` on the first navigation. Nothing fails in the default test order, where `prepare` always runs first. Move the reset into a `setUp`, so the state is ready for every test no matter what order the tests are run in, and no matter which helper pumps the tree. Co-Authored-By: Claude Opus 5 <[email protected]>
chrisbobbe
force-pushed
the
test-order-fixes
branch
from
September 21, 2026 23:26
05a692b to
bbec50b
Compare
Member
Author
|
Thanks for the review! Done. |
chrisbobbe
added a commit
to chrisbobbe/tests
that referenced
this pull request
Oct 8, 2026
Our tests were disabled in flutter#478, quite understandably: they were flaking (flutter/flutter#178364, flutter/flutter#179122), and we went two weeks without responding, where registry/template.test asks contacts to respond within about 72 hours. We've since diagnosed and fixed that flake (a test was implicitly depending on the date/time on a real clock): zulip/zulip-flutter#2454 We also fixed another, rarer flake of the same kind, which showed up in a Claude-assisted audit: zulip/zulip-flutter#2455 (The audit also uncovered some cases where the behavior of a file's tests would depend on the order in which the tests ran, and we fixed those too: zulip/zulip-flutter#2457.) So we're proposing re-enablement. The new pin is zulip/zulip-flutter's `main` on 2026-10-08, which includes all three fixes. Greg has left full-time work on Zulip: https://blog.zulip.com/2026/05/15/announcing-zulip-foundation/ I (Chris) am now the mobile-app lead. This commit removes Greg's contact and adds my coworker Rajesh. On GitHub, we're @chrisbobbe and @rajveermalviya.
4 of 8 tasks
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.
Discovered in the Claude-powered audit that led to #2454 and #2455.
(These aren't active flakes, but we still shouldn't leak state between tests like this, such that the suite's results depend on what order the tests are run in.)