Skip to content

test: loosen gc dry-run lock-wait timing bound - #1041

Merged
janicduplessis merged 1 commit into
mainfrom
fix/1040-gc-dry-run-timing-flake
Sep 24, 2026
Merged

janicduplessis merged 1 commit into
mainfrom
fix/1040-gc-dry-run-timing-flake

Conversation

@janicduplessis

Copy link
Copy Markdown
Collaborator

Description

Windows CI intermittently fails gc.test.ts > "EAS orphan session sweep" >
"dry run does not wait behind an active remote session creation lock",
which asserts the dry run returns in under 500 ms. It failed on main in
run 36041519085 (job 107774581842) with an observed 1028 ms.

Across roughly 111 Windows runs, gc.test.ts shows one random 0.3-2.0 s
scheduling stall per run on windows-latest, landing on a different
EAS-sweep test each time; tests that normally take 20-80 ms stall to
1.6-2.0 s. This assertion had failed only this once in 500 runs since
2026-09-11, consistent with runner noise rather than a product regression:
the timed code path cannot itself wait, since the dry run sets
EAS_LOCK_WAIT_MS = 0 and fails fast on a held claim instead of waiting.

Solution

Loosen the bound from 500 ms to 5,000 ms. That is still tight enough to
catch a real regression, where the dry run waits for
withRemoteSessionLock's 4-minute default instead of failing fast, while
clearing the 2.0 s worst-case stall observed on Windows CI.

Test plan

  • pnpm test packages/stim-cli/src/__tests__/gc.test.ts: 151 passed.
  • pnpm run format:check, pnpm run lint, pnpm run typecheck, pnpm run knip: all pass.

Closes #1040

Windows CI shows a random 0.3 to 2.0 s scheduling stall in gc.test.ts,
landing on a different EAS-sweep test each run. The dry run
fail-fast assertion used a 500 ms bound, tight enough to fail once
in 500 runs on that noise alone even though the timed code path
cannot legitimately wait: EAS_LOCK_WAIT_MS is 0 for dry runs. A 5000
ms bound still catches a regression that made the dry run wait for
withRemoteSessionLock 4 minute default, while clearing the observed
worst-case stall.
@janicduplessis
janicduplessis merged commit 056518b into main Sep 24, 2026
8 checks passed
@janicduplessis
janicduplessis deleted the fix/1040-gc-dry-run-timing-flake branch September 24, 2026 18:53
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.

Windows CI flake: gc.test.ts dry-run lock-wait bound too tight

1 participant