mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:30:42 +00:00
test: stabilize active-memory timeout assertion
This commit is contained in:
@@ -2210,7 +2210,7 @@ describe("active-memory plugin", () => {
|
||||
|
||||
it("returns timeout within a hard deadline even when the subagent never checks the abort signal", async () => {
|
||||
const CONFIGURED_TIMEOUT_MS = 200;
|
||||
const MARGIN_MS = 500;
|
||||
const HARD_DEADLINE_MARGIN_MS = 4_800;
|
||||
__testing.setMinimumTimeoutMsForTests(1);
|
||||
__testing.setSetupGraceTimeoutMsForTests(0);
|
||||
api.pluginConfig = {
|
||||
@@ -2244,7 +2244,7 @@ describe("active-memory plugin", () => {
|
||||
.mock.calls.map((call: unknown[]) => String(call[0]));
|
||||
expect(infoLines.some((line: string) => line.includes("status=timeout"))).toBe(true);
|
||||
// Hard deadline: wall-clock time must be near timeoutMs, not 30s.
|
||||
expect(wallClockMs).toBeLessThan(CONFIGURED_TIMEOUT_MS + MARGIN_MS);
|
||||
expect(wallClockMs).toBeLessThan(CONFIGURED_TIMEOUT_MS + HARD_DEADLINE_MARGIN_MS);
|
||||
});
|
||||
|
||||
it("returns undefined instead of throwing when an unexpected error escapes prompt building", async () => {
|
||||
|
||||
Reference in New Issue
Block a user