Skip to content

Commit 5de8459

Browse files
authored
Merge pull request #5684 from modelcontextprotocol/v2/chore/5683-memory-restore-count-test
test(memory): count a real Windows refusal of the lock put-back as a retry
2 parents ee4f57c + 53afb97 commit 5de8459

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎src/memory/__tests__/file-lock.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,11 @@ describe("withFileLock", () => {
670670
).rejects.toThrow("Timed out");
671671
const outcome = await thirdOutcome;
672672

673-
expect(restores()).toBe(3);
673+
// The two injected refusals were retried and a third attempt went to
674+
// the real rename. On a real Windows host that rename can itself be
675+
// refused while the third writer has the lock open, and is retried
676+
// again, so three is the floor, not the count (#5683).
677+
expect(restores()).toBeGreaterThanOrEqual(3);
674678
expect(third).not.toHaveBeenCalled();
675679
expect((outcome as Error).message).toContain("Timed out");
676680
expect(await fs.readFile(lockPath, "utf-8")).toBe("successor");

0 commit comments

Comments
 (0)