mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:30:42 +00:00
test(exec): cover background timeout opt-out
This commit is contained in:
@@ -246,6 +246,26 @@ test("background exec without explicit timeout applies default timeout", async (
|
||||
});
|
||||
});
|
||||
|
||||
test("background exec with timeout zero bypasses default timeout", async () => {
|
||||
const tool = createTestExecTool({
|
||||
allowBackground: true,
|
||||
backgroundMs: 0,
|
||||
timeoutSec: BACKGROUND_TIMEOUT_SEC,
|
||||
});
|
||||
const result = await tool.execute("toolcall", {
|
||||
command: BACKGROUND_HOLD_CMD,
|
||||
background: true,
|
||||
timeout: 0,
|
||||
});
|
||||
expect(result.details.status).toBe("running");
|
||||
const sessionId = (result.details as { sessionId: string }).sessionId;
|
||||
expect(supervisorMockState.spawnInputs.at(-1)?.timeoutMs).toBeUndefined();
|
||||
expect(getFinishedSession(sessionId)).toBeUndefined();
|
||||
expect(getSession(sessionId)?.exited).toBe(false);
|
||||
|
||||
cleanupRunningSession(sessionId);
|
||||
});
|
||||
|
||||
test("yielded background exec still times out", async () => {
|
||||
const tool = createTestExecTool({ allowBackground: true, backgroundMs: 10 });
|
||||
await expectBackgroundSessionTimesOut({
|
||||
|
||||
Reference in New Issue
Block a user