mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 19:08:27 +00:00
perf(test): consolidate auth/pty/health mini suites
This commit is contained in:
@@ -3,6 +3,7 @@ import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { getSubagentDepthFromSessionStore } from "./subagent-depth.js";
|
||||
import { resolveAgentTimeoutMs } from "./timeout.js";
|
||||
|
||||
describe("getSubagentDepthFromSessionStore", () => {
|
||||
it("uses spawnDepth from the session store when available", () => {
|
||||
@@ -85,3 +86,15 @@ describe("getSubagentDepthFromSessionStore", () => {
|
||||
expect(depth).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("resolveAgentTimeoutMs", () => {
|
||||
it("uses a timer-safe sentinel for no-timeout overrides", () => {
|
||||
expect(resolveAgentTimeoutMs({ overrideSeconds: 0 })).toBe(2_147_000_000);
|
||||
expect(resolveAgentTimeoutMs({ overrideMs: 0 })).toBe(2_147_000_000);
|
||||
});
|
||||
|
||||
it("clamps very large timeout overrides to timer-safe values", () => {
|
||||
expect(resolveAgentTimeoutMs({ overrideSeconds: 9_999_999 })).toBe(2_147_000_000);
|
||||
expect(resolveAgentTimeoutMs({ overrideMs: 9_999_999_999 })).toBe(2_147_000_000);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user