mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #11816 from gaurav1086/fix_race_condition_kv_test
mvcc: fix race in TestKVTxnBlockWriteOperations
This commit is contained in:
commit
d8bbf7f58d
@ -410,10 +410,11 @@ func TestKVTxnBlockWriteOperations(t *testing.T) {
|
|||||||
func() { s.DeleteRange([]byte("foo"), nil) },
|
func() { s.DeleteRange([]byte("foo"), nil) },
|
||||||
}
|
}
|
||||||
for i, tt := range tests {
|
for i, tt := range tests {
|
||||||
|
tf := tt
|
||||||
txn := s.Write(traceutil.TODO())
|
txn := s.Write(traceutil.TODO())
|
||||||
done := make(chan struct{}, 1)
|
done := make(chan struct{}, 1)
|
||||||
go func() {
|
go func() {
|
||||||
tt()
|
tf()
|
||||||
done <- struct{}{}
|
done <- struct{}{}
|
||||||
}()
|
}()
|
||||||
select {
|
select {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user