Skip to content

Commit e555663

Browse files
committed
[kensai] fix Windows EBUSY in test cleanup
rm() with force:true handles ENOENT but not EBUSY. Adding maxRetries:3 lets Node.js retry with 100ms backoff when git processes still hold file locks.
1 parent 955a738 commit e555663

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

claude/kensai/mcp/review/src/repofs/git/git.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,15 @@ describe("Repo", () => {
199199
});
200200

201201
afterAll(async () => {
202-
await rm(repoDir, { recursive: true, force: true });
202+
await rm(repoDir, { recursive: true, force: true, maxRetries: 3 });
203203
});
204204

205205
it("open rejects non-repo directory", async () => {
206206
const nonRepo = await mkdtemp(join(tmpdir(), "kensai-git-test-"));
207207
try {
208208
await expect(Repo.open(nonRepo)).rejects.toThrow(GitError);
209209
} finally {
210-
await rm(nonRepo, { recursive: true, force: true });
210+
await rm(nonRepo, { recursive: true, force: true, maxRetries: 3 });
211211
}
212212
});
213213

@@ -314,7 +314,7 @@ describe("Repo with binary files", () => {
314314
});
315315

316316
afterAll(async () => {
317-
await rm(repoDir, { recursive: true, force: true });
317+
await rm(repoDir, { recursive: true, force: true, maxRetries: 3 });
318318
});
319319

320320
it("changedFiles reports binary with dash counts", async () => {
@@ -351,7 +351,7 @@ describe("Repo log with multi-line messages", () => {
351351
});
352352

353353
afterAll(async () => {
354-
await rm(repoDir, { recursive: true, force: true });
354+
await rm(repoDir, { recursive: true, force: true, maxRetries: 3 });
355355
});
356356

357357
it("parses subject and body separately", async () => {

claude/kensai/mcp/review/src/repofs/pathindex/pathindex.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ describe("PathIndex.new", () => {
261261
});
262262

263263
afterEach(async () => {
264-
await rm(tempDir, { recursive: true });
264+
await rm(tempDir, { recursive: true, maxRetries: 3 });
265265
});
266266

267267
it("empty directory", async () => {

claude/kensai/mcp/review/src/repofs/repofs.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ beforeAll(async () => {
4141
});
4242

4343
afterAll(async () => {
44-
await rm(rootDir, { recursive: true, force: true });
44+
await rm(rootDir, { recursive: true, force: true, maxRetries: 3 });
4545
});
4646

4747
describe("RepoFs.open", () => {

claude/kensai/mcp/review/src/repofs/rg/rg.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ describe("grep", () => {
129129
});
130130

131131
afterAll(async () => {
132-
await rm(testDir, { recursive: true, force: true });
132+
await rm(testDir, { recursive: true, force: true, maxRetries: 3 });
133133
});
134134

135135
it("finds matches across files", async () => {

0 commit comments

Comments
 (0)