diff --git a/delayed/delayed_test.go b/delayed/delayed_test.go index 4519f82..f1ba769 100644 --- a/delayed/delayed_test.go +++ b/delayed/delayed_test.go @@ -27,5 +27,7 @@ func TestDelayed(t *testing.T) { } func TestDelayedAll(t *testing.T) { - dstest.SubtestAll(t, New(datastore.NewMapDatastore(), delay.Fixed(time.Millisecond))) + // Delay for virtually no time, we just want to make sure this works correctly, not that it + // delays anything. + dstest.SubtestAll(t, New(datastore.NewMapDatastore(), delay.Fixed(time.Nanosecond))) } diff --git a/test/suite.go b/test/suite.go index 012f802..4086857 100644 --- a/test/suite.go +++ b/test/suite.go @@ -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" ) @@ -13,7 +15,6 @@ import ( var BasicSubtests = []func(t *testing.T, ds dstore.Datastore){ SubtestBasicPutGet, SubtestNotFounds, - SubtestCombinations, SubtestPrefix, SubtestOrder, SubtestLimit, @@ -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,