Dashboardopencode-loreTest database isolation and independent…

Test database isolation and independently addressable knowledge fixtures

Category: gotcha
Confidence: 1.00
ID: 01a0b3d5-1892-7be8-b661-ac34f1ba1838
Project ID: 6f4be9ff-ed84-4cca-a9e7-732a0b0b8677
Cross-project: No
Recalled in other projects: 1
Source session: 1eG12YcrNV7scAF9Y
Created: 2026-08-26 15:49:06
Updated: 2026-09-18 09:24:42

Cross-Project Recalls

ProjectHitsLast recalled
opencode 1 9d ago

Content

packages/core/test/setup.ts must assign a temporary LORE_DB_PATH; unset paths must make db() throw rather than touch production. Trap: run-level cleanup and singleton reset look sufficient, but aborted shards can leave temp roots while silenced stderr and per-connection path→project-ID caches leak across tests. Fix: reset silenceStderr(false) and invalidateProjectIdCache() after every test, verify no /tmp/opencode/lore-test-* residue, and give near-identical knowledge fixtures independent UUIDs so fuzzy dedup cannot merge them.

Move to: