#604 Passkey browser test: fix two races that fail it on slower runners
–
- github
- github/openchronology/timeline-app
- github/openchronology/timeline-app#604
- pull request
- state:merged
"PostgreSQL 16 / native pgmp / accounts and sharing" failed on #599 and #602 with `the sign-in page asked for a challenge` (`test/passkeys-live-postgres.mjs:124`, from line 311). Two races in the test cause failures like this; the app itself isn't at fault. **1. Counting challenges after a refused autofill (the CI failure).** The step waits for the sign-in page to ask for a new passkey challenge after a refused one. Its baseline was read after `presence(false)`, a DevTools round trip after the refusal. The page asks for the new challenge right away. A trace showed it finishing 9–15 ms after the baseline was read locally. - **Failure:** on a slower runner the count already includes it. With the authenticator then held back, no other request comes, and the 10-second wait fails. - **Reproduced:** adding a 200 ms pause after `presence(false)` makes the old test fail with exactly CI's error. The fixed test passes with the same pause. - **Fix:** the count is now taken in the `waitForResponse` predicate, when the refusal arrives, before any request that follows it. **2. Signing back in while signing out.** `signOut()` left the virtual authenticator answering. After signing out, `/account` becomes the sign-in form, which arms the passkey autofill, and the authenticator could sign straight back in. - **Failure:** the next step (`/login?mode=register`, waiting for "Create your account") then failed. This happened in 1 of 6 local runs before the fix. - **Fix:** `signOut()` now holds the authenticator back (every caller sets it again afterwards) and checks the account is still signed out. **Verification:** with both fixes, 8 of 8 local runs pass in the official Playwright image against PostgreSQL. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/circagraph/timeline-app/pull/604
Related
Open #604 Passkey browser test: fix two races that fail it on slower runners in the timeline