Repository navigation
fix: make auth store startup budget raisable for slow CI runners (#339) - #424
Merged
Merged
Conversation
Adds URLCODE_AUTH_STORE_STARTUP_MS (default and floor 15000, cap 120000) and sets it to 60000 for the workspaces CI job. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This was referenced Sep 22, 2026
Closed
jimhoyd
added a commit
that referenced
this pull request
Sep 23, 2026
…ners (#506) (#536) A nightly windows-latest/node22 `verify` run flaked at auth-core.test.ts:489 (#464's contention regression test): the bounded password-hash wait queue's fixed 2000ms per-waiter timeout let one of 6 concurrent callers time out instead of getting a slot. The queue is a HASH_SLOTS=2 semaphore with a HASH_QUEUE_MAX=16 wait list; each waiter's wait is capped by a single fixed HASH_WAIT_MS. A tail waiter under 6-way contention can sit behind multiple scrypt derivations finishing ahead of it, so its wait scales with how many derivations must complete first, not just one. 2000ms is comfortable headroom locally but leaves no margin on a slower shared CI runner. Mirrors #424's fix for the analogous auth-store startup flake (#339): add hashWaitBudgetMs(), reading URLCODE_AUTH_HASH_WAIT_MS to raise (never lower) the per-waiter budget, default and floor 2000ms, capped at 30000ms. Sets it to 10000ms in the workspace-verify and workspace-integration CI jobs. The queue's depth/slot bounds and the test's "all 6 must fulfill" guarantee are unchanged — this raises the timing headroom rather than weakening the assertion #464 introduced. Adds a focused regression test for the new budget function alongside the existing #464 contention test, following the style of storeStartupBudgetMs's test in auth-store.test.ts. Closes #506 Co-authored-by: Claude Sonnet 5 <[email protected]>
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.
Refs #339
Cause (unverified)
Locally the pagination test runs in ~0.26s (whole file 1.2s) versus 12-18s on windows-latest, so the failures are almost certainly runner slowness (worker + native SQLite open under load), not a product bug. I could not reproduce on Windows, so this is not confirmed.
Change
URLCODE_AUTH_STORE_STARTUP_MSraises the worker readiness budget. Default and floor stay 15000ms, cap 120000ms; invalid or lower values are ignored, so production behavior is unchanged unless an operator opts in.workspacesCI job sets it to 60000.Not addressed
The second symptom (#333,
Narrow the user filtersafter 12.7s) comes from the fixed 5s deadline inexportUserRange, a production bound I deliberately did not loosen. It is the same slowness manifesting later in the test; if it recurs, the test or that bound needs a separate decision. Hence Refs, not Closes.Verification
lint and typecheck pass; packages/auth (198) and packages/admin (64) tests pass. Full
npm run verifystops at check-workspace-links in this worktree because node_modules resolves to the main checkout (environment artifact, not this change).🤖 Generated with Claude Code