fix(tests): use per-test in-memory DB to prevent shared state conflicts
The testDB() function used cache=shared which caused UNIQUE constraint failures when multiple tests seeded the same chip_sets row. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
14e405c101
commit
968a38dd87
1 changed files with 1 additions and 1 deletions
|
|
@ -15,7 +15,7 @@ import (
|
|||
// testDB creates an in-memory SQLite database with the required schema.
|
||||
func testDB(t *testing.T) *sql.DB {
|
||||
t.Helper()
|
||||
db, err := sql.Open("libsql", "file::memory:?cache=shared")
|
||||
db, err := sql.Open("libsql", "file:"+t.Name()+"?mode=memory")
|
||||
if err != nil {
|
||||
t.Fatalf("open test db: %v", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue