Skip to content

Commit

Permalink
Merge commit 'd6bd1ce' into bug/race-close
Browse files Browse the repository at this point in the history
  • Loading branch information
willscott committed Feb 21, 2020
2 parents ea48232 + d6bd1ce commit f662088
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,19 @@ func TestQueryRespectsProcess(t *testing.T) {
addTestCases(t, d, testcases)
}

func TestCloseRace(t *testing.T) {
d, close := newDS(t)
for n := 0; n < 1000; n++ {
d.Put(ds.NewKey(fmt.Sprintf("%d", n)), []byte(fmt.Sprintf("test%d", n)))
}

go close()
tx, _ := d.NewTransaction(false)
for k := range testcases {
tx.Get(ds.NewKey(k))
}
}

func TestQueryRespectsProcessMem(t *testing.T) {
d := newDSMem(t)
addTestCases(t, d, testcases)
Expand Down

0 comments on commit f662088

Please sign in to comment.