Repository navigation
feat(testing): the shared test setup waits for a machine-wide test slot - #677
Merged
Merged
Conversation
leemour
force-pushed
the
feat/test-machine-slots
branch
from
November 21, 2026 02:20
c34eb88 to
e36df4a
Compare
Several agents ran test suites on one machine at once. Each run had its own vitest workers (maxWorkers 4), and together they took every core and all the memory until the computer froze. The setup from @wirecat/cli-base/testing/setup now takes one of 8 slot files in ~/.cache/wirecat-test-slots before a test file starts, and only when at least 4 GB of memory is available (os.freemem, MemAvailable on Linux). The slot is given back in afterAll. A slot whose process is dead is taken back by the next caller. After 10 minutes a file runs without a slot. A wait over 30 seconds prints the holders' PIDs and the off switch. CI skips the guard. WIRECAT_TEST_SLOT_HELD stops a child vitest from waiting on its parent. Settings: WIRECAT_TEST_SLOTS (0 turns it off), WIRECAT_TEST_MIN_FREE_GB, WIRECAT_TEST_MAX_WAIT_S, WIRECAT_TEST_SLOT_DIR. Checked: three suites of 25 files run at once with 3 slots never held more than 3 and left none behind, all 390 tests passed in each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
leemour
force-pushed
the
feat/test-machine-slots
branch
from
November 21, 2026 02:22
e36df4a to
33522e9
Compare
…ives back only its own slot A slot file was created empty and written a moment later. Another run that read it in between saw no PID, took it for a dead run's slot and removed it, so two runs held the same slot and the first release removed the second's. Now the owner is written to a temporary file that is hard-linked into place, and release removes the slot only when it still names this run. Checked: four suites at once with 2 slots never held more than 2 and left none behind; a file whose only slot was held waited 90 s, ran without a slot and passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
leemour
added a commit
that referenced
this pull request
Nov 21, 2026
Dates #677 (the shared test setup waits for a machine-wide test slot) and #683 (a sign-in method in `--wcat-describe` can name `--site` and `--login`) as 0.126.0. Both are Added, so a minor release. The #683 fragment is collected into the section, as 0.125.3 did by hand. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
Several agents ran test suites on one machine at once. Each run had up to 4 vitest workers, and together they took every core and all the memory until the computer froze.
What
src/testing/machine-slot.ts: a test file takes one of 8 slot files in~/.cache/wirecat-test-slots, and only when at least 4 GB of memory is available. It gives the slot back inafterAll. A dead process's slot is taken back. After 10 minutes the file runs without a slot. A wait over 30 s prints who holds the slots.src/testing/setup.tstakes the slot before the sandbox. CI skips the guard.WIRECAT_TEST_SLOTS=0turns it off.Added(a minor release), and a paragraph indocs/dev/TESTING.md.Testing
src/testing/machine-slot.test.ts: 5 tests.src/codegen src/dev), run at once withWIRECAT_TEST_SLOTS=3: never more than 3 slots held, none left behind, 390 of 390 passed in each run.scripts/release-checks.test.ts, the same withWIRECAT_TEST_SLOTS=0. They come from this machine: the test callspython3through the asdf shim, and with the sandboxedHOMEthe shim finds no Python version and exits with 126. Not from this change.🤖 Generated with Claude Code