#330·open-seo

GoogleAccountService test cleanup fails on Windows with EPERM

Author: WuerzeltDevOpsCreated Sep 13, 2026Updated Sep 13, 2026

TL;DR

src/server/features/google/GoogleAccountService.test.ts fails on Windows with EPERM, Permission denied when cleaning up its temp directory. It passes on Linux CI.

What is happening?

afterAll calls client.close() without awaiting it and immediately runs rmSync(directory, { recursive: true }) (GoogleAccountService.test.ts:73-76). On Windows the still-open SQLite file handle blocks deletion of google-account-removal-* in %TEMP%, so the whole suite errors out:

Error: EPERM, Permission denied: \\?\C:\…\Temp\google-account-removal-…

What should happen?

The suite should clean up reliably on Windows, the same way it does on Linux.

Extra context

Repro: pnpm vitest run src/server/features/google/GoogleAccountService.test.ts on Windows. Possible direction: await the client close before removing the directory, or retry the removal briefly.