mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-09 22:48:57 +02:00
test: full suite runs as N shard processes; scrub spec-sync child env
Two fixes from the wedge-hunt endgame: 1. Full-suite mode switches from one 'bun test --parallel' invocation to N concurrent shard PROCESSES, serial within each (the paid runner's proven model; N = min(6, cpus-2)). The single-invocation strategy hit three distinct Bun 1.3.13 worker pathologies in one day — a segfault whose crashed-worker retry wedged the run, a quarantined file's still-running file-level hooks stalling a worker, and spawn-heavy files hanging under load — and each one stalled the WHOLE invocation. Process shards isolate any wedge to its own shard. First full run under this model: no wedge, six epilogues, one real failure named. WORKER_HOSTILE stays as the paper trail; --parallel remains available per-shard for a future Bun. 2. That one real failure: spec-template-sync regenerates SKILL.md via a child that inherited the shard process's env — an earlier test's GSTACK_*/GBRAIN_* mutations changed generator output (failed in-suite, passed solo on an identical tree). The child now gets a scrubbed env: generator output must be a function of the templates, not of whichever test ran before. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
d3e52d4c92
commit
710900bd51
@@ -20,6 +20,17 @@ describe('/spec template/generated sync', () => {
|
||||
cwd: ROOT,
|
||||
encoding: 'utf-8',
|
||||
timeout: 120_000,
|
||||
// Scrubbed env: bun test runs a shard's files serially in ONE process,
|
||||
// so an earlier test's env mutations (GSTACK_*/GBRAIN_* detection vars)
|
||||
// leak into inherited process.env and change generator output — this
|
||||
// test failed in-suite while passing solo on an identical tree. The
|
||||
// generator's output must be a function of the templates, not of
|
||||
// whichever test ran before this one.
|
||||
env: {
|
||||
PATH: process.env.PATH ?? '',
|
||||
HOME: process.env.HOME ?? '',
|
||||
TMPDIR: process.env.TMPDIR ?? '',
|
||||
},
|
||||
});
|
||||
expect(res.status).toBe(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user