fix(kv-store): gate flaky sqlite-opfs browser tests behind VITE_SQLITE_OPFS=1#22693
Merged
spalladino merged 4 commits intomerge-train/spartanfrom Apr 22, 2026
Merged
Conversation
mverzilli
approved these changes
Apr 21, 2026
This was referenced Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
cd yarn-project/kv-store && yarn testconsistently hangs the CI container for 10 min aftersqlite-opfs/multi_map.test.tsfinishes its last test (multiple keys are independent). The next test file never runs. This is reproducible across two CI runs on this branch and was the original merge-train/spartan failure (http://ci.aztec-labs.com/1776770924267106).Initial hypothesis was that
handleDeleteDbwas installing an OPFS SAH Pool for ephemeral:memory:DBs and contending on the OPFS directory lock. Skipping the pool install there is still a real cleanup win, so that change stays. But it did not resolve the hang — CI still times out at the exact same point, so the root cause is somewhere else in thesqlite-opfsbrowser stack (vitest browser-mode file transition, chromium resource exhaustion with dozens of SQLite-WASM workers, or similar).Root-causing this inside the merge-train isn't viable — every failed run holds the train up. Gate the
sqlite-opfsbrowser tests behindVITE_SQLITE_OPFS=1so they stay runnable in dev (they pass consistently locally) but stop blocking CI until someone owning the OPFS backend can dig in. The OPFS backend itself is still marked experimental in #22658.Default CI browser run: 70 tests (indexeddb only), ~7s.
Opt-in with
VITE_SQLITE_OPFS=1: 131 tests (adds sqlite-opfs), ~9s locally — hangs in the CI container.Also keeps the earlier
handleDeleteDbcleanup change (skip pool install on ephemeral DB delete, drop the now-deadpoolDirectoryvariable, dropasyncsince noawaitremains).Follow-up
A proper investigation of the
sqlite-opfsbrowser-test hang belongs in a dedicated issue — likely needs traces from a reproducing CI run. Filing separately.