Skip to content

Commit b9b2ff1

Browse files
committed
Stricter test.
1 parent 78473b4 commit b9b2ff1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/parallel/parallel_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package tests
22

33
import (
4+
"errors"
45
"io"
6+
"log"
57
"net/url"
68
"os"
79
"os/exec"
@@ -19,6 +21,20 @@ import (
1921
"github.com/ncruces/go-sqlite3/vfs/memdb"
2022
)
2123

24+
func TestMain(m *testing.M) {
25+
sqlite3.AutoExtension(func(c *sqlite3.Conn) error {
26+
return c.ConfigLog(func(code sqlite3.ExtendedErrorCode, msg string) {
27+
// Having to do journal recovery is unexpected.
28+
if errors.Is(code, sqlite3.NOTICE) {
29+
log.Panicf("%v (%d): %s", code, code, msg)
30+
} else {
31+
log.Printf("%v (%d): %s", code, code, msg)
32+
}
33+
})
34+
})
35+
m.Run()
36+
}
37+
2238
func Test_parallel(t *testing.T) {
2339
if !vfs.SupportsFileLocking {
2440
t.Skip("skipping without locks")

0 commit comments

Comments
 (0)