MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / rmSyncRobust

Function rmSyncRobust

packages/server/test/fs-git.e2e.test.ts:26–36  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

24let server: RunningServer | undefined;
25
26function rmSyncRobust(path: string): void {
27 try {
28 rmSync(path, { recursive: true, force: true, maxRetries: 60, retryDelay: 250 });
29 } catch (error) {
30 const code = (error as NodeJS.ErrnoException).code;
31 if (code !== 'EPERM' && code !== 'EBUSY' && code !== 'ENOTEMPTY') throw error;
32 // Best-effort cleanup: a child process may still hold the cwd or be
33 // writing into the dir after server.close(); the OS reclaims the temp dir
34 // later and a cleanup hiccup must not fail an otherwise-passing test.
35 }
36}
37
38beforeEach(() => {
39 tmpDir = mkdtempSync(join(tmpdir(), 'kimi-server-fs-git-test-'));

Callers 1

fs-git.e2e.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected