Skip to content

fix(test): give farm.test.ts a file-level budget instead of chasing blocks (#542) - #549

Merged
SUaDtL merged 2 commits into
mainfrom
fix/farm-test-file-timeout
Jul 29, 2026
Merged

fix(test): give farm.test.ts a file-level budget instead of chasing blocks (#542)#549
SUaDtL merged 2 commits into
mainfrom
fix/farm-test-file-timeout

Conversation

@SUaDtL

@SUaDtL SUaDtL commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

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.ts launches 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.

pass fix what happened next
1 raised the single case #542 named (3553 ms isolated, 5331 ms under CI load) seven more in its block timed out
2 raised that block two cases in a different block timed out
3 this one — the file

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.ts deliberately — 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.

SUaDtL added 2 commits July 29, 2026 11:25
…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
@SUaDtL
SUaDtL merged commit bfce919 into main Jul 29, 2026
41 checks passed
@SUaDtL
SUaDtL deleted the fix/farm-test-file-timeout branch July 29, 2026 15:46
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