Patch flaky tests.

This commit is contained in:
Nuno Cruces
2023-10-16 12:26:25 +01:00
parent db3e6da31a
commit f7b16bad5c
2 changed files with 12 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ package sqlite3
import (
"bytes"
"math"
"os"
"testing"
"github.com/ncruces/go-sqlite3/internal/util"
@@ -56,6 +57,12 @@ func Test_sqlite_new(t *testing.T) {
})
t.Run("_MAX_ALLOCATION_SIZE", func(t *testing.T) {
if testing.Short() {
t.Skip("skipping in short mode")
}
if os.Getenv("CI") != "" {
t.Skip("skipping in CI")
}
defer func() { _ = recover() }()
sqlite.new(_MAX_ALLOCATION_SIZE)
sqlite.new(_MAX_ALLOCATION_SIZE)

View File

@@ -7,6 +7,7 @@ import (
"io/fs"
"math"
"os"
"os/user"
"path/filepath"
"syscall"
"testing"
@@ -208,6 +209,10 @@ func Test_vfsAccess(t *testing.T) {
t.Error("can't access file")
}
if usr, err := user.Current(); err == nil && usr.Uid == "0" {
t.Skip("skipping as root")
}
util.WriteString(mod, 8, file)
rc = vfsAccess(ctx, mod, 0, 8, ACCESS_READWRITE, 4)
if rc != _OK {