chore: checkpoint Boss app v2.5.11

This commit is contained in:
AI Bot
2026-06-08 12:22:50 +08:00
parent bddbe8b5ba
commit 3b51641d99
78 changed files with 5706 additions and 954 deletions

View File

@@ -0,0 +1,19 @@
import test from "node:test";
import assert from "node:assert/strict";
import { createSerializedRunner } from "./serialized-runner.mjs";
test("serialized runner releases active task after timeout", async () => {
let calls = 0;
const runner = createSerializedRunner(
() =>
new Promise(() => {
calls += 1;
}),
{ timeoutMs: 10, timeoutErrorMessage: "HEARTBEAT_TIMEOUT" },
);
await assert.rejects(() => runner(), /HEARTBEAT_TIMEOUT/);
await assert.rejects(() => runner(), /HEARTBEAT_TIMEOUT/);
assert.equal(calls, 2);
});