mirror of https://github.com/perkeep/perkeep.git
index/sqlite tests: let sorted/sqlite pkg do initDB and enable WAL
The problem was newSorted was taking care of doing the DB
initialization. It was not only unnecessary, since newKeyValueFromConfig
from sorted/sqlite will do it by calling initDB, but also incorrect
because WAL was not getting enabled. Which is what was causing the
"database is locked" error "fixed" in commit
f6bf779cd6
Change-Id: Ib4badeda4ed4c6c4be43d5f7fc4c543a467b0cd1
This commit is contained in:
parent
f6bf779cd6
commit
ac6acf5d70
|
@ -31,7 +31,7 @@ import (
|
|||
"camlistore.org/pkg/jsonconfig"
|
||||
"camlistore.org/pkg/sorted"
|
||||
"camlistore.org/pkg/sorted/kvtest"
|
||||
"camlistore.org/pkg/sorted/sqlite"
|
||||
_ "camlistore.org/pkg/sorted/sqlite"
|
||||
|
||||
_ "camlistore.org/third_party/github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
@ -54,14 +54,6 @@ func newSorted(t *testing.T) (kv sorted.KeyValue, clean func()) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
db, err := sql.Open("sqlite3", f.Name())
|
||||
if err != nil {
|
||||
t.Fatalf("opening test database: %v", err)
|
||||
}
|
||||
for _, tableSql := range sqlite.SQLCreateTables() {
|
||||
do(db, tableSql)
|
||||
}
|
||||
do(db, fmt.Sprintf(`REPLACE INTO meta VALUES ('version', '%d')`, sqlite.SchemaVersion()))
|
||||
|
||||
kv, err = sorted.NewKeyValue(jsonconfig.Obj{
|
||||
"type": "sqlite",
|
||||
|
|
Loading…
Reference in New Issue