Skip to content

Commit 577eabd

Browse files
committed
test(e2e): drop Cache=Shared from SQLite E2E connection string (TST-60)
Addresses gemini-code-assist[bot] medium finding on PR #949. SQLite's shared-cache mode introduces internal table-level locking that can actually increase SQLITE_BUSY contention in multi-threaded scenarios compared to the default private-cache mode. Since the backend does not enable WAL, Cache=Shared trades clearer reader/writer concurrency for denser lock contention — the opposite of what we need for parallel E2E. Keep `Pooling=True;Default Timeout=30`, which are the knobs that actually help: connection reuse plus a generous busy-wait. Document the rationale and note WAL as a future option.
1 parent cb6fb1c commit 577eabd

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

frontend/taskdeck-web/playwright.config.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,23 @@ const e2eDbPath = process.env.TASKDECK_E2E_DB ?? 'taskdeck.e2e.db'
1919
* data is already isolated. The remaining contention is at the SQLite engine level:
2020
* parallel writes on the same database file can briefly block each other.
2121
*
22-
* - Cache=Shared — connections in the backend share a page cache, reducing
23-
* read contention.
2422
* - Pooling=True — reuse connection objects (also Microsoft.Data.Sqlite default).
2523
* - Default Timeout=30 — wait up to 30 seconds on a busy lock before surfacing
2624
* SQLITE_BUSY. Parallel E2E traffic is bursty but short,
2725
* so a generous wait masks transient contention without
2826
* hiding genuine deadlocks (real deadlocks still time out).
2927
*
28+
* We intentionally do NOT set `Cache=Shared`: shared-cache mode adds internal
29+
* table-level locking that can increase contention (and SQLITE_BUSY frequency)
30+
* in multi-threaded scenarios rather than reduce it. Future work may enable WAL
31+
* (`PRAGMA journal_mode=WAL;`) in the backend for genuine concurrent-read
32+
* throughput; until then the default private-cache mode plus a generous busy
33+
* timeout is the safer default.
34+
*
3035
* These are additive: they do not alter the on-disk format or the test database path,
3136
* and they are scoped to the E2E backend process launched by this config.
3237
*/
33-
const e2eSqliteConnectionOptions = 'Cache=Shared;Pooling=True;Default Timeout=30'
38+
const e2eSqliteConnectionOptions = 'Pooling=True;Default Timeout=30'
3439
const e2eConnectionString = `Data Source=${e2eDbPath};${e2eSqliteConnectionOptions}`
3540
const defaultApiBaseUrl = 'http://localhost:5000/api'
3641
const demoBackendLlmEnv = resolveDemoBackendLlmEnv(process.env)

0 commit comments

Comments
 (0)