mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-07 08:26:57 +00:00
run.test.ts's afterEach kills openidea-server and removes its home directory, but a language server's own process (jdtls's JVM) outlives the server and keeps writing .metadata underneath it, so the removal races its writes (ENOTEMPTY). Retries only narrow the window: three occurrences after the retry bump prove the JVM can linger past them. The server now spawns detached (its own process group, which its children inherit), and close() reaps the whole group after the server exits (SIGKILL + gone-poll on POSIX, taskkill /T /F on Windows), so the directory removal can't race anyone. debug.test.ts's teardown now awaits close() too.