Summary
bun test fails 247 of 6283 tests on Windows 11 at d97cac23, while bun run build and bun run lint are both clean on the same checkout. CI is ubuntu-latest-only, so nothing upstream exercises this.
71% of the failures (173 of 243 (fail) lines) trace to one helper. src/__tests__/helpers/createTestDb.ts deletes the temp SQLite directory while the database handle is still open, and its own comment names the assumption:
// Remove the entire temp directory. bun:sqlite doesn't expose a close()
// method on our DbClient interface; on macOS/Linux the file can still be
// deleted while the handle is open, and the handle goes out of scope once
// the test function returns.
await fs.rm(path.dirname(tmpFile), { recursive: true, force: true })
POSIX unlink drops the directory entry and lets the open handle live on. Windows refuses to delete a file that still has an open handle, so the teardown throws EBUSY — 366 occurrences in the log.
The blocker is already recorded as a TODO five lines above, for the Postgres path:
// TODO: extend DbClient with a close() method to properly terminate the
// Postgres connection pool.
DbClient (server/db/client.ts) has no close(), so neither adapter can release its handle.
Steps to reproduce
- On Windows 11, clone at
d97cac23
bun install
bun test
Minimal case — 0 pass / 6 fail on its own:
bun test src\__tests__\db\sqlite-smoke.test.ts
Failing files also fail when run individually, so this isn't cross-file ordering or parallelism.
Expected behavior
bun test passes on Windows, as it does on Linux.
Actual behavior
EBUSY: resource busy or locked, rm 'C:\Users\<user>\AppData\Local\Temp\cms-test-b7f28ffc-...'
syscall: "rm",
errno: -16,
code: "EBUSY"
at async <anonymous> (src\__tests__\helpers\createTestDb.ts:58:16)
at async <anonymous> (src\__tests__\db\sqlite-smoke.test.ts:60:13)
Highest-hit files: siteDocumentSave (24), staticArtefact (20), authStepUp (17), accountSecurity (16), pluginScheduler (9), cmsDataAuthorization (9), apiSecurityBoundary (9), sqlite-smoke (6).
Two smaller Windows issues account for a further ~7 (paths built as URLs, giving '/C:/...' with a leading slash before the drive letter). The remaining ~60 I haven't root-caused and some may be downstream of the failing teardowns — happy to open those separately once this one is settled.
Glad to send a PR adding close() to DbClient and calling it before the rm, if that's the direction you'd want.
Version or commit
d97cac23 (v0.0.14). Bun 1.3.14, Windows 11 Home 10.0.22631.
Deployment mode
Local dev with Bun
Summary
bun testfails 247 of 6283 tests on Windows 11 atd97cac23, whilebun run buildandbun run lintare both clean on the same checkout. CI isubuntu-latest-only, so nothing upstream exercises this.71% of the failures (173 of 243
(fail)lines) trace to one helper.src/__tests__/helpers/createTestDb.tsdeletes the temp SQLite directory while the database handle is still open, and its own comment names the assumption:POSIX
unlinkdrops the directory entry and lets the open handle live on. Windows refuses to delete a file that still has an open handle, so the teardown throwsEBUSY— 366 occurrences in the log.The blocker is already recorded as a TODO five lines above, for the Postgres path:
DbClient(server/db/client.ts) has noclose(), so neither adapter can release its handle.Steps to reproduce
d97cac23bun installbun testMinimal case — 0 pass / 6 fail on its own:
Failing files also fail when run individually, so this isn't cross-file ordering or parallelism.
Expected behavior
bun testpasses on Windows, as it does on Linux.Actual behavior
Highest-hit files:
siteDocumentSave(24),staticArtefact(20),authStepUp(17),accountSecurity(16),pluginScheduler(9),cmsDataAuthorization(9),apiSecurityBoundary(9),sqlite-smoke(6).Two smaller Windows issues account for a further ~7 (paths built as URLs, giving
'/C:/...'with a leading slash before the drive letter). The remaining ~60 I haven't root-caused and some may be downstream of the failing teardowns — happy to open those separately once this one is settled.Glad to send a PR adding
close()toDbClientand calling it before therm, if that's the direction you'd want.Version or commit
d97cac23(v0.0.14). Bun 1.3.14, Windows 11 Home 10.0.22631.Deployment mode
Local dev with Bun