Repository navigation
test(memory): count a real Windows refusal of the lock put-back as a retry - #5684
Conversation
…retry, not a failure The put-back test injected two EPERM refusals and asserted exactly three attempts, but on a real Windows host the third, real rename can be refused too while the third writer holds the lock open, and restoreLock retries it. Assert three as the floor. Closes #5683 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: cliffhall <cliff@futurescale.com>
|
|
| Tools | Prompts | Resources | Resource templates | |
|---|---|---|---|---|
| Base | 9 | 0 | 1 | 0 |
| Head | 9 | 0 | 1 | 0 |
Updated by this run for 53afb97437da20225756908b0de1f1d4de766724.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the test-only adjustment accommodating additional Windows lock-restoration attempts.
No open issues 🎉
What changed in this PR
Addresses #5683 by correcting an intermittent Windows failure in the memory server’s lock-restoration test. The change allows additional real rename refusals while preserving the existing lock-safety assertions.
Changes:
- Requires at least three restoration attempts instead of exactly three.
- Explains why Windows may require extra attempts. No production code changes.
| File | Description |
|---|---|
src/memory/__tests__/file-lock.test.ts |
Relaxes the attempt-count assertion and documents the Windows rename race. |
Review effort: Balanced
Closes #5683
Description
The memory lock test "keeps putting a live lock back while Windows refuses to replace the lock created in the gap" injects two
EPERMrefusals of the put-back, then lets the third attempt reach the realfs.rename, and asserted exactly three attempts. On a real Windows runner that real rename can also be refused while the test's third writer has the lock open, whichrestoreLockretries as designed, so the count is sometimes 4. The assertion is now>= 3: the injected refusals were retried and the put-back landed. The test's other assertions (the third writer never ran, the successor's lock is back, nothing is left aside) are unchanged.Server Details
src/memory/__tests__/file-lock.test.ts. No source change.Motivation and Context
It failed
Test memory (Windows)on the dispatched TypeScript run for the v2.6.0 CalVer PR #5682, which touches no TypeScript: https://github.com/modelcontextprotocol/servers/actions/runs/45967890810/job/140400944527 (expected 4 to be 3). Found during the v2.6.0 release (#5681). Analysis in #5683.How Has This Been Tested?
npm test -w src/memory -- __tests__/file-lock.test.tslocally (macOS): 57 / 57 pass. The Windows path this test models only really races on a Windows host, so this PR's CITest memory (Windows)job is the evidence that matters.npm run local:gatewas skipped at the maintainer's direction: a one-assertion test change whose meaningful run is Windows CI.Breaking Changes
None.
Types of changes
Checklist
🤖 Generated with Claude Code