fix(e2e): bound cron mcp probe waits

This commit is contained in:
Vincent Koc
2026-06-01 18:52:09 +02:00
parent 3113fe95ea
commit f2eea90dac
2 changed files with 57 additions and 6 deletions

View File

@@ -0,0 +1,20 @@
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { describe, expect, it } from "vitest";
import { waitForProbePid } from "../../scripts/e2e/cron-mcp-cleanup-docker-client.ts";
describe("cron MCP cleanup docker client", () => {
it("bounds missing probe pid waits", async () => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-cron-mcp-client-"));
try {
const startedAt = Date.now();
await expect(
waitForProbePid(path.join(root, "missing.pid"), { pollMs: 1, timeoutMs: 20 }),
).resolves.toBeUndefined();
expect(Date.now() - startedAt).toBeLessThan(1000);
} finally {
fs.rmSync(root, { force: true, recursive: true });
}
});
});