fix(test): give farm.test.ts a file-level budget instead of chasing blocks (#542) - #549
Merged
Conversation
…locks (#542) Third pass, and the last, because the budget finally matches the population it applies to. EVERY case in this file launches a real farm subprocess. Process creation on a hosted Windows runner is far slower than on a developer box, so the 5000ms default is marginal for the WHOLE FILE - not for any one case in it. pass 1: raised the single case #542 named (measured: 3553ms isolated, 5331ms under CI load). Seven more in its block then timed out. pass 2: raised that block. Two cases in a DIFFERENT block then timed out. pass 3: this one. Each pass fixed the sample the last failure happened to name, and the next-slowest case was always waiting behind it. That is the actual lesson, and it cost two round trips through CI to learn: when a failure names one member of a population, size the fix to the population. 30s is ~6x the slowest measured run and still bounded, so a genuine hang fails rather than sitting until the job timeout. Scoped to this file rather than vitest.config.ts deliberately - the sibling suites are ordinary in-process unit tests, and a 30s default there would turn a hung unit test from a 5s failure into a 30s one. The block-level timeout from pass 2 is removed: two sources of truth for one budget is how they drift apart. 537 tests pass. Test-only; the payload gate confirms no shipped change. Claude-Session: https://claude.ai/code/session_01WJgVfZw7J81PB7mwpHyUxx
…meout # Conflicts: # .codearbiter/gate-events.log
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.
Third pass on #542, and the last — because the budget finally matches the population it applies to.
What kept happening
Every case in
farm.test.tslaunches a real farm subprocess. Process creation on a hosted Windows runner is far slower than on a developer box, so the 5000 ms default is marginal for the whole file — not for any one case in it.Each pass fixed the sample the last failure happened to name, and the next-slowest case was always waiting behind it. That is the actual lesson, and it cost two round trips through CI to learn: when a failure names one member of a population, size the fix to the population.
The fix
vi.setConfig({ testTimeout: 30_000 })for this file. ~6× the slowest measured run and still bounded, so a genuine hang fails rather than sitting until the job timeout.Scoped to this file rather than
vitest.config.tsdeliberately — the sibling suites are ordinary in-process unit tests, and a 30 s default there would turn a hung unit test from a 5 s failure into a 30 s one.The block-level timeout from pass 2 is removed: two sources of truth for one budget is how they drift apart.
Verification
537 tests pass across all 9 files. Test-only — the payload gate confirms no shipped change, so no version bump.
The real proof is this PR's
Coverage union <os: windows-latest>cell, which is what caught both previous incomplete fixes.