Skip to content

fix(kv-store): skip pool creation on ephemeral deleteDb to unstick browser tests#22703

Closed
AztecBot wants to merge 1 commit intomerge-train/fairiesfrom
claudebox/fix-fairies-kv-store-hang
Closed

fix(kv-store): skip pool creation on ephemeral deleteDb to unstick browser tests#22703
AztecBot wants to merge 1 commit intomerge-train/fairiesfrom
claudebox/fix-fairies-kv-store-hang

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

What

yarn-project/kv-store/src/sqlite-opfs/worker.ts::handleDeleteDb installed an OPFS SAH Pool on every teardown, even for :memory: ephemeral DBs (which never back a file). The OPFS SAH Pool acquires an exclusive directory lock, and under heavy test churn + CPU contention (CI runs this container with --cpus=2) the next test's pool install can block indefinitely waiting for the previous terminated worker's OPFS handles to release. The deleteDb RPC has no timeout, so afterEach hangs and the whole yarn test run times out.

All kv-store browser tests use AztecSQLiteOPFSStore.open(mockLogger, undefined, true) (ephemeral), so handleInit never sets up a pool for them — there is literally nothing to unlink. Skip the pool install in that case.

Non-ephemeral stores are unchanged: handleInit still calls ensurePool, so pool is set by the time handleDeleteDb runs and pool.unlink(path) still removes the file.

Identical to #22693 (same hang hitting merge-train/spartan); applying directly to merge-train/fairies to unblock this train.

Failing CI

Full analysis: https://gist.github.com/AztecBot/d904db7c7b11fdbc895c99ba44478f22

Verification

  • yarn test:browser — 131 passed / 2 skipped (~9.7s).
  • yarn test:node — 264 passed.

The full ./bootstrap.sh ci was not run — it takes hours and this fix is scoped to one function, mirroring the previously-verified #22693. Targeted browser-test runs exercise the exact hung code path.

ClaudeBox log: https://claudebox.work/s/a3fe40193c79379c?run=1

ClaudeBox log: https://claudebox.work/s/a3fe40193c79379c?run=1

@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels Apr 21, 2026
@AztecBot
Copy link
Copy Markdown
Collaborator Author

Automatically closing this stale claudebox draft PR (no updates for 5+ days). Re-open if still needed.

@AztecBot AztecBot closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant