test: spawn timeouts on absorbed-PR tests (v1.77 sync-spawn tripwire)

The absorbed community tests (#2748, #2676, #2714, #2720) were authored
before the v1.77 tripwire required a timeout on every sync spawn in the test
trees.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-08-31 21:12:39 +00:00
co-authored by Claude Fable 5
parent 47cb8a838a
commit 84c0eee9f2
4 changed files with 4 additions and 1 deletions
+1
View File
@@ -19,6 +19,7 @@ let stateRoot: string;
function cfg(args: string[]): { code: number; out: string; err: string } { function cfg(args: string[]): { code: number; out: string; err: string } {
const r = spawnSync(CONFIG, args, { const r = spawnSync(CONFIG, args, {
timeout: 30_000,
encoding: "utf8", encoding: "utf8",
env: { ...process.env, GSTACK_STATE_ROOT: stateRoot }, env: { ...process.env, GSTACK_STATE_ROOT: stateRoot },
}); });
+1
View File
@@ -342,6 +342,7 @@ describe('gstack-skill-start behavior', () => {
fs.writeFileSync(path.join(freshGh, '.feature-prompted-model-overlay'), ''); fs.writeFileSync(path.join(freshGh, '.feature-prompted-model-overlay'), '');
const acknowledged = execFileSync(localStart, ['--skill', 'testskill'], { const acknowledged = execFileSync(localStart, ['--skill', 'testskill'], {
timeout: 30_000,
encoding: 'utf-8', encoding: 'utf-8',
cwd: projectRoot, cwd: projectRoot,
env, env,
+1
View File
@@ -35,6 +35,7 @@ function runBin(bin: string, args: string[], env: Record<string, string> = {}) {
// cannot exec a shebang script directly (spawn would fail before the code // cannot exec a shebang script directly (spawn would fail before the code
// under test ever ran). // under test ever ran).
const r = spawnSync('bash', [path.join(HOSTILE, 'bin', bin), ...args], { const r = spawnSync('bash', [path.join(HOSTILE, 'bin', bin), ...args], {
timeout: 30_000,
encoding: 'utf-8', encoding: 'utf-8',
env: { ...process.env, GSTACK_HOME: STATE, GSTACK_STATE_ROOT: '', ...env }, env: { ...process.env, GSTACK_HOME: STATE, GSTACK_STATE_ROOT: '', ...env },
shell: false, shell: false,
+1 -1
View File
@@ -49,7 +49,7 @@ function extractViaSkill(source: string, field: 'pid' | 'port', stateFile: strin
// have to be reproduced here. // have to be reproduced here.
const pipeline = line!.slice(line!.indexOf('grep -o')); const pipeline = line!.slice(line!.indexOf('grep -o'));
const script = `cat ${JSON.stringify(stateFile)} | ${pipeline.replace(/\)$/, '')}`; const script = `cat ${JSON.stringify(stateFile)} | ${pipeline.replace(/\)$/, '')}`;
return execFileSync('bash', ['-c', script], { encoding: 'utf-8' }).trim(); return execFileSync('bash', ['-c', script], { encoding: 'utf-8', timeout: 30_000 }).trim();
} }
describe('/open-gstack-browser state-file extraction', () => { describe('/open-gstack-browser state-file extraction', () => {