Skip to content

Name the auth store startup stage in timeouts (refs #339) - #341

Merged
jimhoyd merged 1 commit into
mainfrom
fix/auth-startup-stage-339
Sep 20, 2026
Merged

jimhoyd merged 1 commit into
mainfrom
fix/auth-startup-stage-339

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Refs #339 (does not close it).

What the evidence says

Windows failures (jobs 106140203347 for #328, 106144892279 for #333, first attempts) versus passing Windows runs:

Test failing attempt same job re-run 4 other passing Windows jobs ubuntu / macos
pagination test 17.4 s (#328), 12.7 s (#333) 2.3 s 1.1 to 3.5 s 0.53 s
kit-rendered admin pages ... (untouched, same file set) 19.9 s 2.5 s 1.7 to 2.5 s 1.1 to 1.4 s
whole admin suite 61.4 s 28.9 s n/a n/a
  • In Data-bound list and form screen in ui, composed by init --with ui,store (refs #262) #328 the whole runner was slow at once: unrelated tests in the same suite ran about 8x slower in the same attempt, and the workspace auth suite took 166 s versus 144 s on re-run. A test that takes about 2 s when healthy did not become 12 to 18 s by itself.
  • The worker was not racing. It reported online after 22 ms and message wiring is synchronous with new Worker (no await in between). Its startup (open, WAL and synchronous=FULL fsyncs, schema transaction) then took more than 15 s where it normally takes well under a second. That is a stall, not a lost message.
  • The Structured JSON error body for body-schema 422 (refs #320) #333 failure is the same cause through a different door: exportUserRange has a fixed 5 s product deadline covering about 55 fsync-bound store calls (adminExport per user); under the same I/O stall it legitimately returns 413 Narrow the user filters.
  • So this is not (a) a code race, and not (c) test weight as such (about 2 s healthy, 0.5 s on Linux/macOS). It is closest to (b)/environmental: transient stalls on the Windows runner. I could not reproduce on Windows (no Windows machine here), so this PR does not claim a fix.

What I did not change, and why

  • Not raising the 15 s readiness budget: nothing shows 15 s is the wrong number, only that the runner stalled for longer than that; a higher number would mask, not explain, the stall.
  • Not cheapening the seeding: importUsers skips the external-identity link that the method=oidc filter in this test depends on, so using it would weaken what the test proves. The 5 s export deadline is product behavior and stays.

The change (diagnostic only)

The next occurrence should be attributable. The worker now posts { stage } progress messages (database opened, journal mode set) and the startup timeout message includes the last stage reached, or says the database open itself had not returned. awaitStoreStartup ignores progress messages for settling and removes its listener when the bound elapses. No behavior, timing or budget changes; message text for the timeout gains a suffix.

Verified

  • npm ci and npm run verify (including verify:workspaces) pass locally on macOS. Local SQLite may lack the patch level for some auth tests; CI covers that.
  • New unit test covers stage reporting and listener cleanup.

Not verified / open decisions

  • Windows behavior (only CI can show it).
  • Recommendation: leave [Bug]: Windows admin pagination test is flaky (auth store worker startup timeout) #339 open, let this land, and on the next failure read the stage. If it is always journal mode set (the WAL/fsync step) after a long stall, consider raising the budget for CI only, or making verify on Windows run the admin suite with lower test concurrency. Your call.
  • Whether to also give the range-export deadline injectable time in tests.

🤖 Generated with Claude Code

@jimhoyd
jimhoyd merged commit 612a4e9 into main Sep 20, 2026
20 checks passed
@jimhoyd
jimhoyd deleted the fix/auth-startup-stage-339 branch September 20, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant