Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/tmp-rm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ test("rmrf: a transient storm past the budget throws after the full ladder", ()
} finally {
_setRmImplForTest();
}
assert.equal(calls, 8, "one attempt + all seven backoffs, then give up");
assert.ok(Date.now() - t0 >= 3100, "paid the 25..1600ms ladder (~3.2s)");
assert.equal(calls, 10, "one attempt + all nine backoffs, then give up");
assert.ok(Date.now() - t0 >= 9400, "paid the 25..3200ms ladder (~9.6s)");
});

test("rmrf: non-transient errors throw at once, no backoff", () => {
Expand Down
13 changes: 10 additions & 3 deletions tests/tmp-rm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@ import { rmSync } from "node:fs";
// ubuntu-22 release-gate leg — the failing suite's late debounced session
// flush (5ms debounce recreating <tmp>/<provider>/) kept the tree alive past
// every retry under full-suite load. Escalate with exponential backoff so
// teardown can always outlive a bounded writer burst; the full window is
// ~3.2s and is only paid when a race actually happens.
const RETRY_DELAYS_MS = [25, 50, 100, 200, 400, 800, 1600] as const;
// teardown can always outlive a bounded writer burst; the ladder below sums
// the full window and is only paid when a race actually happens.
//
// #2908: #2816's c=4 concurrent test scheduling raised per-runner load, and a
// win-latest leg then lost the race on EBUSY unlinking sessions/index.db — a
// transient Windows AV/indexer lock outlasting the old ~3.2s window (#2799
// family). A probe confirmed the harness holds NO self-handle at rmrf time
// (flushAllSessions closes the store's shadow first), so this is not masking
// an in-process leak: it re-sizes the external-lock budget to the c=4 reality.
const RETRY_DELAYS_MS = [25, 50, 100, 200, 400, 800, 1600, 3200, 3200] as const;

/** Sync sleep that is legal on any thread in Node (blocks the event loop —
* exactly what a teardown-path retry wants; no pending I/O ordering to keep). */
Expand Down
Loading