You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(desktop): exact-selection Project test races on add order and fails cleanup on Windows #5834
apps/desktop/src/main/__tests__/project-management-service.test.ts › "add preserves the exact selected directory inside an existing repository" became nondeterministic in #5786, and it fails on every run on Windows.
Failure 1: selection order races (all platforms)
The test now runs await Promise.all([service.add(), service.add()]) and then asserts that setSelection was called in the order repository, then nested. setSelection fires when each add() settles, so the order depends on which call finishes first.
Repro: delay the first chooseDirectory resolution by 50 ms, and the test fails every time.
Failure 2: EBUSY during cleanup (Windows)
t.after(() => rm(base)) is registered before t.after(() => catalog.close()). after hooks run in registration order, so the directory is removed while runtime.sqlite is still open:
EBUSY: resource busy or locked, unlink '...\maka-project-exact-selection-XXXX\storage\runtime.sqlite'
This happens 30 times out of 30 locally on Windows. Linux doesn't notice, because it can unlink open files.
Fix
Add the Projects sequentially, as the test did before #5786; the test is about exact directory selection, not concurrency. Close the catalog, then remove the directory, in a single hook.
Activity