fix(tests): the post-compact hook test takes its child timeout from the shared timing helper

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-10-15 15:43:36 +02:00
commit c9248bbb52
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
4 changed files with 40 additions and 5 deletions

View file

@ -13,6 +13,7 @@ import { join, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { execFile } from 'node:child_process';
import { childEnv } from '../helpers/child-env.mjs';
import { HOOK_CHILD_TIMEOUT_MS } from '../helpers/timing.mjs';
const HERE = dirname(fileURLToPath(import.meta.url));
const ROOT = join(HERE, '..', '..');
@ -23,10 +24,10 @@ function runHookIn(cwd, input = {}) {
const child = execFile(
'node',
[HOOK],
{ timeout: 5000, cwd, env: childEnv() },
{ timeout: HOOK_CHILD_TIMEOUT_MS, cwd, env: childEnv() },
(err, stdout, stderr) => {
resolve({
code: child.exitCode ?? 0,
code: child.exitCode ?? 1,
stdout: stdout || '',
stderr: stderr || '',
});