Skip to content

Commit

Permalink
Stricter test.
Browse files Browse the repository at this point in the history
  • Loading branch information
ncruces committed Aug 30, 2024
1 parent 78473b4 commit b9b2ff1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/parallel/parallel_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package tests

import (
"errors"
"io"
"log"
"net/url"
"os"
"os/exec"
Expand All @@ -19,6 +21,20 @@ import (
"github.com/ncruces/go-sqlite3/vfs/memdb"
)

func TestMain(m *testing.M) {
sqlite3.AutoExtension(func(c *sqlite3.Conn) error {
return c.ConfigLog(func(code sqlite3.ExtendedErrorCode, msg string) {
// Having to do journal recovery is unexpected.
if errors.Is(code, sqlite3.NOTICE) {
log.Panicf("%v (%d): %s", code, code, msg)
} else {
log.Printf("%v (%d): %s", code, code, msg)
}
})
})
m.Run()
}

func Test_parallel(t *testing.T) {
if !vfs.SupportsFileLocking {
t.Skip("skipping without locks")
Expand Down

0 comments on commit b9b2ff1

Please sign in to comment.