diff options
| author | Luke Parker <[email protected]> | 2026-03-06 15:42:08 +1000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-06 15:42:08 +1000 |
| commit | aec6ca71fa544ca8b5e4997f5475abc72e6e924d (patch) | |
| tree | c254e9684bea1a01804c5c7cf7c171a22ba3644a /packages/app/e2e | |
| parent | c04da45be51994496f44e4fe238fbffbec89cb37 (diff) | |
| download | opencode-aec6ca71fa544ca8b5e4997f5475abc72e6e924d.tar.gz opencode-aec6ca71fa544ca8b5e4997f5475abc72e6e924d.zip | |
fix(git): stop leaking fsmonitor daemons e.g. 60GB+ of commited memory after running tests (#16249)
Diffstat (limited to 'packages/app/e2e')
| -rw-r--r-- | packages/app/e2e/actions.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/app/e2e/actions.ts b/packages/app/e2e/actions.ts index a7ccba617..fbb13008b 100644 --- a/packages/app/e2e/actions.ts +++ b/packages/app/e2e/actions.ts @@ -197,6 +197,7 @@ export async function createTestProject() { await fs.writeFile(path.join(root, "README.md"), "# e2e\n") execSync("git init", { cwd: root, stdio: "ignore" }) + execSync("git config core.fsmonitor false", { cwd: root, stdio: "ignore" }) execSync("git add -A", { cwd: root, stdio: "ignore" }) execSync('git -c user.name="e2e" -c user.email="[email protected]" commit -m "init" --allow-empty', { cwd: root, @@ -207,7 +208,10 @@ export async function createTestProject() { } export async function cleanupTestProject(directory: string) { - await fs.rm(directory, { recursive: true, force: true }).catch(() => undefined) + try { + execSync("git fsmonitor--daemon stop", { cwd: directory, stdio: "ignore" }) + } catch {} + await fs.rm(directory, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 }).catch(() => undefined) } export function sessionIDFromUrl(url: string) { |
