fix: avoid shared cache memory databases (#926)

This commit is contained in:
Nuno Cruces
2025-09-30 21:51:51 -07:00
committed by GitHub
parent 3ccb883b2f
commit e8e94295cc
3 changed files with 7 additions and 9 deletions
+2 -1
View File
@@ -23,6 +23,7 @@ import (
"github.com/garethgeorge/backrest/internal/resticinstaller"
"github.com/garethgeorge/backrest/internal/testutil"
"github.com/google/go-cmp/cmp"
"github.com/ncruces/go-sqlite3/vfs/memdb"
"golang.org/x/net/http2"
"golang.org/x/net/http2/h2c"
"google.golang.org/protobuf/encoding/protojson"
@@ -748,7 +749,7 @@ func newPeerUnderTest(t *testing.T, initialConfig *v1.Config) *peerUnderTest {
wg.Done()
}()
dbpool, err := sql.Open("sqlite3", "file:"+cryptoutil.MustRandomID(64)+"?mode=memory&cache=shared")
dbpool, err := sql.Open("sqlite3", memdb.TestDB(t))
if err != nil {
t.Fatalf("failed to open sqlite pool: %v", err)
}