mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-24 13:11:15 +00:00
test: speed exec no-output timer (#108037)
This commit is contained in:
committed by
GitHub
parent
5bbf30b852
commit
ccefa7c028
@@ -9,22 +9,22 @@ describe("runCommandWithTimeout no-output timer", () => {
|
||||
"let timer",
|
||||
"const emit = () => {",
|
||||
" process.stdout.write('.')",
|
||||
" if (++count === 6) { clearInterval(timer); process.exit(0) }",
|
||||
" if (++count === 21) { clearInterval(timer); process.exit(0) }",
|
||||
"}",
|
||||
"emit()",
|
||||
"timer = setInterval(emit, 500)",
|
||||
"timer = setInterval(emit, 100)",
|
||||
].join(";");
|
||||
const result = await runCommandWithTimeout([process.execPath, "-e", script], {
|
||||
timeoutMs: 10_000,
|
||||
// Leave ample process-startup margin while keeping total runtime above
|
||||
// this threshold, so only output-driven resets let the child finish.
|
||||
noOutputTimeoutMs: 2_000,
|
||||
noOutputTimeoutMs: 1_500,
|
||||
});
|
||||
|
||||
expect(result).toMatchObject({
|
||||
code: 0,
|
||||
noOutputTimedOut: false,
|
||||
stdout: "......",
|
||||
stdout: ".....................",
|
||||
termination: "exit",
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user