Repository navigation
Fix race in update-check toast test (flaky on CI desktop) - #9
Merged
Merged
Conversation
The route intercepting the checker's no-store re-fetch was installed only
after page.goto('load') returned, but update-check.js fires its first
re-fetch ~2 s after the script parses — before 'load'. On slow CI runners
the first check therefore saw the unmodified page, and the checker's 30 s
throttle pushed the next check ~60 s out, past the test's 15 s timeout
(failed twice on CI desktop, passed on mobile/local where load is fast).
Install the route before the navigation and distinguish the initial
navigation by request order instead of sec-fetch-dest — that header is
not populated on Playwright-intercepted requests, so the old check never
fired. Verified with a 3 s artificially slowed navigation.
Sellafield
approved these changes
Oct 15, 2026
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.
Follow-up to #8: the
Tests (Playwright)job failed on two consecutive runs (main #6 push and the #8 PR) with the same single failure —update-check.spec.js › toast appears when the deployed page changedon desktop — while passing on mobile and locally.Root cause
A race in the test itself:
page.goto(..., waitUntil: 'load')returnedupdate-check.jsfires its first re-fetch ~2 s after the script parses — that script runs at the end of<body>, i.e. before theloadeventFix
Test-only change to
tests/update-check.spec.js:sec-fetch-dest— that header is not populated on Playwright-intercepted requests (verified:undefinedfor every request in this setup), so the oldisNavigationcheck never fired and would have broken a pre-installed routeVerified: 3× consecutive full spec passes (desktop+mobile), plus a throwaway scenario with a 3 s artificially slowed navigation — passes in 5.3 s.