Skip to content

Commit

Permalink
Tests: Use t.Parallel in TestIteratePrefix tests (#1377)
Browse files Browse the repository at this point in the history
Fixes #1376

# before changes
$ git stash
$ ./test.sh
....
PASS
ok  	github.com/dgraph-io/badger/v2	802.360s

# took 27m 47s

# with changes
$ git stash apply
$ ./test.sh
...
PASS
ok  	github.com/dgraph-io/badger/v2	541.394s

# took 18m 38s
  • Loading branch information
ekalinin committed Jun 20, 2020
1 parent 3f4761d commit d37ce36
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions iterator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,14 @@ func TestIteratePrefix(t *testing.T) {
}

t.Run("With Default options", func(t *testing.T) {
t.Parallel()
runBadgerTest(t, nil, func(t *testing.T, db *DB) {
testIteratorPrefix(t, db)
})
})

t.Run("With Block Offsets in Cache", func(t *testing.T) {
t.Parallel()
opts := getTestOptions("")
opts = opts.WithKeepBlockIndicesInCache(true)
runBadgerTest(t, &opts, func(t *testing.T, db *DB) {
Expand All @@ -215,6 +217,7 @@ func TestIteratePrefix(t *testing.T) {
})

t.Run("With Block Offsets and Blocks in Cache", func(t *testing.T) {
t.Parallel()
opts := getTestOptions("")
opts = opts.WithKeepBlockIndicesInCache(true).WithKeepBlocksInCache(true)
runBadgerTest(t, &opts, func(t *testing.T, db *DB) {
Expand All @@ -223,6 +226,7 @@ func TestIteratePrefix(t *testing.T) {
})

t.Run("With Blocks in Cache", func(t *testing.T) {
t.Parallel()
opts := getTestOptions("")
opts = opts.WithKeepBlocksInCache(true)
runBadgerTest(t, &opts, func(t *testing.T, db *DB) {
Expand Down

0 comments on commit d37ce36

Please sign in to comment.