Skip to content

Commit

Permalink
test: disable expensive query test with race detector
Browse files Browse the repository at this point in the history
It's _really_ slow. We still test queries under the race detector, this
is just an exhaustive logic test.
  • Loading branch information
Stebalien committed Jul 12, 2021
1 parent cb04af7 commit 006ea6b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"runtime"
"testing"

detectrace "github.com/ipfs/go-detect-race"

dstore "github.com/ipfs/go-datastore"
query "github.com/ipfs/go-datastore/query"
)
Expand All @@ -13,7 +15,6 @@ import (
var BasicSubtests = []func(t *testing.T, ds dstore.Datastore){
SubtestBasicPutGet,
SubtestNotFounds,
SubtestCombinations,
SubtestPrefix,
SubtestOrder,
SubtestLimit,
Expand All @@ -23,6 +24,13 @@ var BasicSubtests = []func(t *testing.T, ds dstore.Datastore){
SubtestBasicSync,
}

// Only enable the expensive "combinations" test when not running the race detector.
func init() {
if !detectrace.WithRace() {
BasicSubtests = append(BasicSubtests, SubtestCombinations)
}
}

// BatchSubtests is a list of all basic batching datastore tests.
var BatchSubtests = []func(t *testing.T, ds dstore.Batching){
RunBatchTest,
Expand Down

0 comments on commit 006ea6b

Please sign in to comment.