mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-26 16:06:16 +00:00
test: tighten process timeout fixtures
This commit is contained in:
@@ -34,10 +34,10 @@ describe("runCommandWithTimeout", () => {
|
||||
|
||||
it("kills command when no output timeout elapses", async () => {
|
||||
const result = await runCommandWithTimeout(
|
||||
[process.execPath, "-e", "setTimeout(() => {}, 60)"],
|
||||
[process.execPath, "-e", "setTimeout(() => {}, 40)"],
|
||||
{
|
||||
timeoutMs: 1_000,
|
||||
noOutputTimeoutMs: 35,
|
||||
timeoutMs: 500,
|
||||
noOutputTimeoutMs: 20,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -51,11 +51,11 @@ describe("runCommandWithTimeout", () => {
|
||||
[
|
||||
process.execPath,
|
||||
"-e",
|
||||
'process.stdout.write("."); setTimeout(() => process.stdout.write("."), 30); setTimeout(() => process.exit(0), 60);',
|
||||
'process.stdout.write("."); setTimeout(() => process.stdout.write("."), 20); setTimeout(() => process.exit(0), 40);',
|
||||
],
|
||||
{
|
||||
timeoutMs: 1_000,
|
||||
noOutputTimeoutMs: 500,
|
||||
timeoutMs: 500,
|
||||
noOutputTimeoutMs: 250,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -68,7 +68,7 @@ describe("runCommandWithTimeout", () => {
|
||||
|
||||
it("reports global timeout termination when overall timeout elapses", async () => {
|
||||
const result = await runCommandWithTimeout(
|
||||
[process.execPath, "-e", "setTimeout(() => {}, 60)"],
|
||||
[process.execPath, "-e", "setTimeout(() => {}, 40)"],
|
||||
{
|
||||
timeoutMs: 15,
|
||||
},
|
||||
|
||||
@@ -19,7 +19,7 @@ describe("process supervisor", () => {
|
||||
const run = await spawnChild(supervisor, {
|
||||
sessionId: "s1",
|
||||
argv: [process.execPath, "-e", 'process.stdout.write("ok")'],
|
||||
timeoutMs: 2_500,
|
||||
timeoutMs: 1_000,
|
||||
stdinMode: "pipe-closed",
|
||||
});
|
||||
const exit = await run.wait();
|
||||
@@ -32,8 +32,8 @@ describe("process supervisor", () => {
|
||||
const supervisor = createProcessSupervisor();
|
||||
const run = await spawnChild(supervisor, {
|
||||
sessionId: "s1",
|
||||
argv: [process.execPath, "-e", "setTimeout(() => {}, 60)"],
|
||||
timeoutMs: 1_000,
|
||||
argv: [process.execPath, "-e", "setTimeout(() => {}, 40)"],
|
||||
timeoutMs: 500,
|
||||
noOutputTimeoutMs: 20,
|
||||
stdinMode: "pipe-closed",
|
||||
});
|
||||
@@ -48,8 +48,8 @@ describe("process supervisor", () => {
|
||||
const first = await spawnChild(supervisor, {
|
||||
sessionId: "s1",
|
||||
scopeKey: "scope:a",
|
||||
argv: [process.execPath, "-e", "setTimeout(() => {}, 60)"],
|
||||
timeoutMs: 1_000,
|
||||
argv: [process.execPath, "-e", "setTimeout(() => {}, 40)"],
|
||||
timeoutMs: 500,
|
||||
stdinMode: "pipe-open",
|
||||
});
|
||||
|
||||
@@ -58,7 +58,7 @@ describe("process supervisor", () => {
|
||||
scopeKey: "scope:a",
|
||||
replaceExistingScope: true,
|
||||
argv: [process.execPath, "-e", 'process.stdout.write("new")'],
|
||||
timeoutMs: 2_500,
|
||||
timeoutMs: 1_000,
|
||||
stdinMode: "pipe-closed",
|
||||
});
|
||||
|
||||
@@ -73,7 +73,7 @@ describe("process supervisor", () => {
|
||||
const supervisor = createProcessSupervisor();
|
||||
const run = await spawnChild(supervisor, {
|
||||
sessionId: "s-timeout",
|
||||
argv: [process.execPath, "-e", "setTimeout(() => {}, 60)"],
|
||||
argv: [process.execPath, "-e", "setTimeout(() => {}, 40)"],
|
||||
timeoutMs: 1,
|
||||
stdinMode: "pipe-closed",
|
||||
});
|
||||
@@ -88,7 +88,7 @@ describe("process supervisor", () => {
|
||||
const run = await spawnChild(supervisor, {
|
||||
sessionId: "s-capture",
|
||||
argv: [process.execPath, "-e", 'process.stdout.write("streamed")'],
|
||||
timeoutMs: 2_500,
|
||||
timeoutMs: 1_000,
|
||||
stdinMode: "pipe-closed",
|
||||
captureOutput: false,
|
||||
onStdout: (chunk) => {
|
||||
|
||||
Reference in New Issue
Block a user