Skip to content

Commit f7b16ba

Browse files
committed
Patch flaky tests.
1 parent db3e6da commit f7b16ba

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

sqlite_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package sqlite3
33
import (
44
"bytes"
55
"math"
6+
"os"
67
"testing"
78

89
"github.com/ncruces/go-sqlite3/internal/util"
@@ -56,6 +57,12 @@ func Test_sqlite_new(t *testing.T) {
5657
})
5758

5859
t.Run("_MAX_ALLOCATION_SIZE", func(t *testing.T) {
60+
if testing.Short() {
61+
t.Skip("skipping in short mode")
62+
}
63+
if os.Getenv("CI") != "" {
64+
t.Skip("skipping in CI")
65+
}
5966
defer func() { _ = recover() }()
6067
sqlite.new(_MAX_ALLOCATION_SIZE)
6168
sqlite.new(_MAX_ALLOCATION_SIZE)

vfs/vfs_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"io/fs"
88
"math"
99
"os"
10+
"os/user"
1011
"path/filepath"
1112
"syscall"
1213
"testing"
@@ -208,6 +209,10 @@ func Test_vfsAccess(t *testing.T) {
208209
t.Error("can't access file")
209210
}
210211

212+
if usr, err := user.Current(); err == nil && usr.Uid == "0" {
213+
t.Skip("skipping as root")
214+
}
215+
211216
util.WriteString(mod, 8, file)
212217
rc = vfsAccess(ctx, mod, 0, 8, ACCESS_READWRITE, 4)
213218
if rc != _OK {

0 commit comments

Comments
 (0)