test(supabase_flutter): deflake the expired session stream expectation - #1720
test(supabase_flutter): deflake the expired session stream expectation#1720spydon wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe expired-session authentication stream test now skips intermediate ChangesAuth stream test
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to This test-only change makes the expired-session assertion deterministic by tolerating intermediate state events before the expected error; no actionable merge-blocking risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What kind of change does this PR introduce?
Test fix for a flaky WASM CI failure on main.
What is the current behavior?
Expired session emits exception when no auto refreshwaits a fixed 100ms and then asserts that the next event ononAuthStateChangeis an error:The session recovery flow emits
initialSession, thensignedOut(withsignOutReason: sessionExpired), and only after the logout HTTP call fails does theAuthExceptionreach the stream. SinceReplaySubjectreplays only the latest event, the test passes only when the whole flow, including the HTTP roundtrip, completes within the 100ms budget. On a slow runner the subscription lands betweensignedOutand the error, the replayed event is a data event, andemitsErrorfails:This is exactly the failure seen on the main WASM runs starting with the run for #1716. The race is unrelated to that commit: reducing the delay reproduces the identical failure on 29286f4, the commit before it, and both failing CI runs executed concurrently on loaded runners while all passing runs did not.
What is the new behavior?
The test drops the fixed delay and skips past data events until the error arrives, which is deterministic for every interleaving:
Verified locally on the VM and with
flutter test --platform chrome --wasm.Summary by CodeRabbit