fix conditions
This commit is contained in:
parent
d3877a13e5
commit
669faec71c
1 changed files with 4 additions and 4 deletions
|
@ -67,8 +67,8 @@ func TestKeyLock_DeadlockFree(t *testing.T) {
|
|||
defer wg.Done()
|
||||
|
||||
for i := 0; i < N; i++ {
|
||||
locked, unlock := l.LockKeys(keys, nil)
|
||||
if !locked {
|
||||
cancelled, unlock := l.LockKeys(keys, nil)
|
||||
if cancelled {
|
||||
t.Error("spurious lock failure")
|
||||
return
|
||||
}
|
||||
|
@ -100,8 +100,8 @@ func TestKeyLock_SingleKeyStress(t *testing.T) {
|
|||
defer wg.Done()
|
||||
|
||||
for i := 0; i < N; i++ {
|
||||
locked, unlock := l.LockKeys([]string{"a"}, timeout(time.Millisecond))
|
||||
if locked {
|
||||
cancelled, unlock := l.LockKeys([]string{"a"}, timeout(time.Millisecond))
|
||||
if !cancelled {
|
||||
unlock()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue