diff --git a/fragment_internal_test.go b/fragment_internal_test.go index b33862d54..a47f9fa4b 100644 --- a/fragment_internal_test.go +++ b/fragment_internal_test.go @@ -33,13 +33,13 @@ import ( "testing" "testing/quick" - "golang.org/x/sync/errgroup" - "github.com/davecgh/go-spew/spew" "github.com/pilosa/pilosa/v2/pql" + "github.com/pilosa/pilosa/v2/race" "github.com/pilosa/pilosa/v2/roaring" "github.com/pilosa/pilosa/v2/testhook" "github.com/pkg/errors" + "golang.org/x/sync/errgroup" ) // Test flags @@ -450,6 +450,10 @@ func TestFragment_SetValue(t *testing.T) { }) t.Run("QuickCheck", func(t *testing.T) { + if os.Getenv("PILOSA_TXSRC") == "rbf" && race.Enabled { + t.Skip("race detection enabled, skipping for rbf") + } + if err := quick.Check(func(bitDepth uint, bitN uint64, values []uint64) bool { // Limit bit depth & maximum values. bitDepth = (bitDepth % 62) + 1 diff --git a/rbf/rbf_norace.go b/race/norace.go similarity index 86% rename from rbf/rbf_norace.go rename to race/norace.go index 15667ee93..6626c8380 100644 --- a/rbf/rbf_norace.go +++ b/race/norace.go @@ -14,7 +14,7 @@ // +build !race -package rbf +package race -// RaceEnabled is true if the -race flag is enabled. -const RaceEnabled = false +// Enabled is true if the -race flag is enabled. +const Enabled = false diff --git a/rbf/rbf_race.go b/race/race.go similarity index 87% rename from rbf/rbf_race.go rename to race/race.go index e178a736b..a6fe765bc 100644 --- a/rbf/rbf_race.go +++ b/race/race.go @@ -14,7 +14,7 @@ // +build race -package rbf +package race -// RaceEnabled is true if the -race flag is enabled. -const RaceEnabled = true +// Enabled is true if the -race flag is enabled. +const Enabled = true diff --git a/rbf/cursor_test.go b/rbf/cursor_test.go index 40f2756f0..401117d06 100644 --- a/rbf/cursor_test.go +++ b/rbf/cursor_test.go @@ -23,6 +23,7 @@ import ( "strings" "testing" + "github.com/pilosa/pilosa/v2/race" "github.com/pilosa/pilosa/v2/rbf" "github.com/pilosa/pilosa/v2/roaring" ) @@ -76,7 +77,7 @@ func TestCursor_FirstNext_Quick(t *testing.T) { t.Skip("-short enabled, skipping") } else if is32Bit() { t.Skip("32-bit build, skipping quick check tests") - } else if rbf.RaceEnabled { + } else if race.Enabled { t.Skip("race detection enabled, skipping") } @@ -198,7 +199,7 @@ func TestCursor_LastPrev_Quick(t *testing.T) { t.Skip("-short enabled, skipping") } else if is32Bit() { t.Skip("32-bit build, skipping quick check tests") - } else if rbf.RaceEnabled { + } else if race.Enabled { t.Skip("race detection enabled, skipping") } @@ -312,7 +313,7 @@ func TestCursor_Union(t *testing.T) { t.Skip("-short enabled, skipping") } else if is32Bit() { t.Skip("32-bit build, skipping quick check tests") - } else if rbf.RaceEnabled { + } else if race.Enabled { t.Skip("race detection enabled, skipping") } @@ -393,7 +394,7 @@ func TestCursor_Intersect(t *testing.T) { t.Skip("-short enabled, skipping") } else if is32Bit() { t.Skip("32-bit build, skipping quick check tests") - } else if rbf.RaceEnabled { + } else if race.Enabled { t.Skip("race detection enabled, skipping") } diff --git a/rbf/tx_test.go b/rbf/tx_test.go index defd0ac23..7e723aa8a 100644 --- a/rbf/tx_test.go +++ b/rbf/tx_test.go @@ -21,6 +21,7 @@ import ( "testing" "time" + "github.com/pilosa/pilosa/v2/race" "github.com/pilosa/pilosa/v2/rbf" "github.com/pilosa/pilosa/v2/txkey" ) @@ -218,7 +219,7 @@ func TestTx_Add_Quick(t *testing.T) { t.Skip("-short enabled, skipping") } else if is32Bit() { t.Skip("32-bit build, skipping quick check tests") - } else if rbf.RaceEnabled { + } else if race.Enabled { t.Skip("race detection enabled, skipping") } @@ -257,7 +258,7 @@ func TestTx_AddRemove_Quick(t *testing.T) { t.Skip("-short enabled, skipping") } else if is32Bit() { t.Skip("32-bit build, skipping quick check tests") - } else if rbf.RaceEnabled { + } else if race.Enabled { t.Skip("race detection enabled, skipping") } diff --git a/server/cluster_test.go b/server/cluster_test.go index f1a73a921..7b17a253d 100644 --- a/server/cluster_test.go +++ b/server/cluster_test.go @@ -25,9 +25,9 @@ import ( "testing" "time" - "github.com/pilosa/pilosa/v2/server" - "github.com/pilosa/pilosa/v2" + "github.com/pilosa/pilosa/v2/race" + "github.com/pilosa/pilosa/v2/server" "github.com/pilosa/pilosa/v2/test" "golang.org/x/sync/errgroup" ) @@ -634,6 +634,10 @@ func TestCluster_GossipMembership(t *testing.T) { } func TestClusterResize_RemoveNode(t *testing.T) { + if os.Getenv("PILOSA_TXSRC") == "rbf" && race.Enabled { + t.Skip("race detection enabled, skipping for rbf") + } + cluster := test.MustRunCluster(t, 3) defer cluster.Close() m0 := cluster.GetNode(0) diff --git a/server/server_test.go b/server/server_test.go index 270fdcaf5..02af30e59 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -34,6 +34,7 @@ import ( "github.com/pilosa/pilosa/v2" "github.com/pilosa/pilosa/v2/http" "github.com/pilosa/pilosa/v2/pql" + "github.com/pilosa/pilosa/v2/race" "github.com/pilosa/pilosa/v2/roaring" "github.com/pilosa/pilosa/v2/server" "github.com/pilosa/pilosa/v2/test" @@ -51,6 +52,8 @@ func init() { // nolint: gochecknoinits func TestMain_Set_Quick(t *testing.T) { if testing.Short() { t.Skip("short") + } else if os.Getenv("PILOSA_TXSRC") == "rbf" && race.Enabled { + t.Skip("race detection enabled, skipping for rbf") } for i := 0; i < 100; i++ { @@ -947,6 +950,10 @@ func TestMain_ImportTimestampNoStandardView(t *testing.T) { } func TestClusterQueriesAfterRestart(t *testing.T) { + if os.Getenv("PILOSA_TXSRC") == "rbf" && race.Enabled { + t.Skip("race detection enabled, skipping for rbf") + } + cluster := test.MustRunCluster(t, 3) defer cluster.Close() cmd1 := cluster.GetNode(1) @@ -1171,6 +1178,10 @@ func TestClusterExhaustingConnectionsImport(t *testing.T) { } func TestClusterMinMaxSumDecimal(t *testing.T) { + if os.Getenv("PILOSA_TXSRC") == "rbf" && race.Enabled { + t.Skip("race detection enabled, skipping for rbf") + } + cluster := test.MustRunCluster(t, 3) defer cluster.Close() cmd := cluster.GetNode(0)