From 79d09955a2fe36c0e79a73fcebac7158451d2f6e Mon Sep 17 00:00:00 2001 From: Fedor Korotkiy Date: Mon, 16 Mar 2020 13:20:09 +0300 Subject: [PATCH] Fix keylock after patch --- keylock/keylock_test.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/keylock/keylock_test.go b/keylock/keylock_test.go index 12a460c..762a855 100644 --- a/keylock/keylock_test.go +++ b/keylock/keylock_test.go @@ -25,24 +25,24 @@ func TestKeyLock_Simple(t *testing.T) { l := keylock.New() - locked, unlock := l.LockKeys([]string{"a", "b"}, nil) - require.True(t, locked) + canceled, unlock := l.LockKeys([]string{"a", "b"}, nil) + require.False(t, canceled) - locked, _ = l.LockKeys([]string{"", "b", "c"}, timeout(time.Millisecond*10)) - require.False(t, locked) + canceled, _ = l.LockKeys([]string{"", "b", "c"}, timeout(time.Millisecond*10)) + require.True(t, canceled) unlock() - locked, _ = l.LockKeys([]string{"", "b", "c"}, nil) - require.True(t, locked) + canceled, _ = l.LockKeys([]string{"", "b", "c"}, nil) + require.False(t, canceled) } func TestKeyLock_Progress(t *testing.T) { defer goleak.VerifyNone(t) l := keylock.New() - locked, unlock := l.LockKeys([]string{"a", "b"}, nil) - require.True(t, locked) + canceled, unlock := l.LockKeys([]string{"a", "b"}, nil) + require.False(t, canceled) defer unlock() go func() { @@ -50,8 +50,8 @@ func TestKeyLock_Progress(t *testing.T) { }() time.Sleep(time.Millisecond * 10) - locked, _ = l.LockKeys([]string{"d"}, nil) - require.True(t, locked) + canceled, _ = l.LockKeys([]string{"d"}, nil) + require.False(t, canceled) } func TestKeyLock_DeadlockFree(t *testing.T) {