mirror of https://github.com/openclaw/openclaw.git
test(perf): clear concurrent-start timeout handle in cron regression test
This commit is contained in:
parent
8e0ca219a4
commit
f01862bce2
|
|
@ -1491,12 +1491,14 @@ describe("Cron issue regressions", () => {
|
|||
});
|
||||
|
||||
const timerPromise = onTimer(state);
|
||||
await Promise.race([
|
||||
bothRunsStarted.promise,
|
||||
new Promise<never>((_, reject) =>
|
||||
setTimeout(() => reject(new Error("timed out waiting for concurrent job starts")), 1_000),
|
||||
),
|
||||
]);
|
||||
const startTimeout = setTimeout(() => {
|
||||
bothRunsStarted.reject(new Error("timed out waiting for concurrent job starts"));
|
||||
}, 250);
|
||||
try {
|
||||
await bothRunsStarted.promise;
|
||||
} finally {
|
||||
clearTimeout(startTimeout);
|
||||
}
|
||||
|
||||
expect(peakActiveRuns).toBe(2);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue