Repository navigation
test(e2e): wait for sign-out to finish before navigating - #102
TusanHomichi wants to merge 1 commit into
Conversation
The shell keeps a signed-in browser out of /login and /reset. Twelve browser steps clicked Sign out and navigated straight on; when the logout request was still in flight (a loaded CI runner), /reset bounced to the home page and the next fill waited out the test timeout. It failed pr-gate on #91 in drafts.spec.ts:113. One owning helper, signOut(page) in fixtures.ts, clicks Sign out and waits for /login, which the shell reaches only after the server ends the session. Every plain sign-out goes through it; the one deliberate exception tests that a failed save refuses sign-out. A scratch spec that delays the logout response by 1.5 s reproduced the bounce with the old pattern and passed with the helper. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Superseded: this exact commit was ported into #91 as Verification of the change on Generated by Claude Code |
Primary Issue
There's no separate issue. This is a test-only fix for a failure found on #91's
pr-gaterun. It is related to, but distinct from, #83 (a different intermittent spec).Problem And Outcome
pr-gateon #91 (e9f3758) failed indrafts.spec.ts:113: the test timed out atgetByLabel('Username')on/reset. The PR's diff did not cause it.The cause is a race in the tests. The shell keeps a signed-in browser out of
/loginand/reset;shell.spec.tsalready notes "Still signed in → guard bounces to status". Twelve steps indrafts.spec.tsandsessions.spec.tsclick Sign out and immediatelygoto('/reset')or fill the sign-in form. If the logout request is still in flight, as it can be on a loaded runner,/resetbounces to the home page. For a trainer, home has no Username field, so the test waits out its 60 s timeout. Locally the test runs in 27–29 s, so the race window is normally hidden.After this PR, no test can move on before the server has ended the session.
Changes
web/e2e/fixtures.ts: a newsignOut(page)helper clicks Sign out and waits for/login. The shell only navigates there afterlogout()resolves.draft-recovery.spec.ts:2419, which tests that a failed save refuses sign-out. Redundant/loginassertions after the helper are removed.Correction rung: 1 (one owning API). Waiting is now the only way the specs sign out.
Scope
Verification
page.routedelaysPOST /api/auth/logoutby 1.5 s.goto('/reset')) lands on home and fails.npm run check: 0 errors.pr-gate: pending; receipt to follow.Review And Merge Notes
🤖 Generated with Claude Code
https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
Generated by Claude Code