mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-14 00:49:00 +02:00
fix: sweep — every sync spawn in the test trees carries a timeout (436 sites, 157 files)
spawnSync/execSync/Bun.spawnSync BLOCK the main thread, so bun's in-process per-test timeout can never fire while one waits — a hung child (stdin read, network probe, dead daemon) wedges the whole shard until the runner's external wall-clock SIGKILL. This exact class reached main: free-tests run 33262077256, test/gstack-memory-ingest.test.ts (normally 2.3s) held shard 2 at the 360s wall while its five siblings finished in ~65s. Mechanical sweep in two waves (12 + 4 fan-out agents, every edit verified against its call site): default timeout: 30_000 (matches the free runner's per-test budget), 120_000 for genuinely slow ops (installs, builds, playwright, provider CLIs), helper wrappers fixed ONCE where call sites route through them. Sites that only LOOK like calls (string fixtures, grep needles, comments) were skipped with reasons — the enforcement commit that follows marks them exempt. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
79efe395dc
commit
3e674e4c01
@@ -43,7 +43,7 @@ describe('setup: Conductor worktree guard', () => {
|
||||
fs.mkdirSync(source);
|
||||
fs.mkdirSync(dest);
|
||||
// The buggy invocation: target dest is an existing real dir.
|
||||
const result = spawnSync('ln', ['-snf', source, dest], { encoding: 'utf-8' });
|
||||
const result = spawnSync('ln', ['-snf', source, dest], { encoding: 'utf-8', timeout: 30_000 });
|
||||
expect(result.status).toBe(0);
|
||||
// Child symlink leaked inside dest.
|
||||
const leaked = path.join(dest, path.basename(source));
|
||||
@@ -85,7 +85,7 @@ describe('setup: Conductor worktree guard', () => {
|
||||
echo "LINKED"
|
||||
fi
|
||||
`;
|
||||
const result = spawnSync('bash', ['-c', script], { encoding: 'utf-8' });
|
||||
const result = spawnSync('bash', ['-c', script], { encoding: 'utf-8', timeout: 30_000 });
|
||||
expect(result.status).toBe(0);
|
||||
expect(result.stdout.trim()).toBe('SKIP');
|
||||
// No child symlink leaked.
|
||||
@@ -120,7 +120,7 @@ describe('setup: Conductor worktree guard', () => {
|
||||
echo "LINKED"
|
||||
fi
|
||||
`;
|
||||
const result = spawnSync('bash', ['-c', script], { encoding: 'utf-8' });
|
||||
const result = spawnSync('bash', ['-c', script], { encoding: 'utf-8', timeout: 30_000 });
|
||||
expect(result.status).toBe(0);
|
||||
expect(result.stdout.trim()).toBe('LINKED');
|
||||
expect(fs.lstatSync(dest).isSymbolicLink()).toBe(true);
|
||||
@@ -159,7 +159,7 @@ describe('setup: Conductor worktree guard', () => {
|
||||
echo "LINKED"
|
||||
fi
|
||||
`;
|
||||
const result = spawnSync('bash', ['-c', script], { encoding: 'utf-8' });
|
||||
const result = spawnSync('bash', ['-c', script], { encoding: 'utf-8', timeout: 30_000 });
|
||||
expect(result.status).toBe(0);
|
||||
expect(result.stdout.trim()).toBe('LINKED');
|
||||
expect(fs.readlinkSync(dest)).toBe(source);
|
||||
@@ -191,7 +191,7 @@ describe('setup: Conductor worktree guard', () => {
|
||||
fi
|
||||
echo "skip=$_SKIP_CLAUDE_REGISTER"
|
||||
`;
|
||||
const result = spawnSync('bash', ['-c', script], { encoding: 'utf-8' });
|
||||
const result = spawnSync('bash', ['-c', script], { encoding: 'utf-8', timeout: 30_000 });
|
||||
expect(result.status).toBe(0);
|
||||
expect(result.stdout.trim()).toBe('skip=0');
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user