perf(test): shorten process timeout fixtures

This commit is contained in:
Peter Steinberger
2026-02-18 04:27:01 +00:00
parent 46278e22cf
commit 308e09c876
2 changed files with 16 additions and 16 deletions

View File

@@ -38,10 +38,10 @@ describe("runCommandWithTimeout", () => {
it("kills command when no output timeout elapses", async () => {
const result = await runCommandWithTimeout(
[process.execPath, "-e", "setTimeout(() => {}, 10_000)"],
[process.execPath, "-e", "setTimeout(() => {}, 1_000)"],
{
timeoutMs: 5_000,
noOutputTimeoutMs: 50,
timeoutMs: 1_000,
noOutputTimeoutMs: 35,
},
);
@@ -55,11 +55,11 @@ describe("runCommandWithTimeout", () => {
[
process.execPath,
"-e",
'let i=0; const t=setInterval(() => { process.stdout.write("."); i += 1; if (i >= 2) { clearInterval(t); process.exit(0); } }, 10);',
'let i=0; const t=setInterval(() => { process.stdout.write("."); i += 1; if (i >= 2) { clearInterval(t); process.exit(0); } }, 5);',
],
{
timeoutMs: 5_000,
noOutputTimeoutMs: 160,
timeoutMs: 1_000,
noOutputTimeoutMs: 120,
},
);
@@ -72,7 +72,7 @@ describe("runCommandWithTimeout", () => {
it("reports global timeout termination when overall timeout elapses", async () => {
const result = await runCommandWithTimeout(
[process.execPath, "-e", "setTimeout(() => {}, 10_000)"],
[process.execPath, "-e", "setTimeout(() => {}, 1_000)"],
{
timeoutMs: 15,
},