Skip to content

Commit

Permalink
Merge pull request etcd-io#11816 from gaurav1086/fix_race_condition_k…
Browse files Browse the repository at this point in the history
…v_test

mvcc: fix race in TestKVTxnBlockWriteOperations
  • Loading branch information
philips authored Apr 28, 2020
2 parents b28a627 + e5ddc91 commit d8bbf7f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mvcc/kv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,11 @@ func TestKVTxnBlockWriteOperations(t *testing.T) {
func() { s.DeleteRange([]byte("foo"), nil) },
}
for i, tt := range tests {
tf := tt
txn := s.Write(traceutil.TODO())
done := make(chan struct{}, 1)
go func() {
tt()
tf()
done <- struct{}{}
}()
select {
Expand Down

0 comments on commit d8bbf7f

Please sign in to comment.