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

Function rmSyncRobust

packages/server/test/question.e2e.test.ts:37–47  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

35let server: RunningServer | undefined;
36
37function rmSyncRobust(path: string): void {
38 try {
39 rmSync(path, { recursive: true, force: true, maxRetries: 60, retryDelay: 250 });
40 } catch (error) {
41 const code = (error as NodeJS.ErrnoException).code;
42 if (code !== 'EPERM' && code !== 'EBUSY' && code !== 'ENOTEMPTY') throw error;
43 // Best-effort cleanup: a child process may still hold the cwd or be
44 // writing into the dir after server.close(); the OS reclaims the temp dir
45 // later and a cleanup hiccup must not fail an otherwise-passing test.
46 }
47}
48
49beforeEach(() => {
50 tmpDir = mkdtempSync(join(tmpdir(), 'kimi-server-questions-test-'));

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected