From 8ce5f2975882029caece81bc3bc25788e0b60cb5 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 7 Apr 2023 20:03:51 +0200 Subject: [PATCH] lock: increase test timeout tolerances to avoid test failures --- cmd/restic/lock_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/restic/lock_test.go b/cmd/restic/lock_test.go index ad9161739..cb386312c 100644 --- a/cmd/restic/lock_test.go +++ b/cmd/restic/lock_test.go @@ -188,7 +188,7 @@ func TestLockWaitTimeout(t *testing.T) { "create normal lock with exclusively locked repo didn't return an error") test.Assert(t, strings.Contains(err.Error(), "repository is already locked exclusively"), "create normal lock with exclusively locked repo didn't return the correct error") - test.Assert(t, retryLock <= duration && duration < retryLock+5*time.Millisecond, + test.Assert(t, retryLock <= duration && duration < retryLock+50*time.Millisecond, "create normal lock with exclusively locked repo didn't wait for the specified timeout") test.OK(t, lock.Unlock()) @@ -215,7 +215,7 @@ func TestLockWaitCancel(t *testing.T) { "create normal lock with exclusively locked repo didn't return an error") test.Assert(t, strings.Contains(err.Error(), "context canceled"), "create normal lock with exclusively locked repo didn't return the correct error") - test.Assert(t, cancelAfter <= duration && duration < cancelAfter+5*time.Millisecond, + test.Assert(t, cancelAfter <= duration && duration < cancelAfter+50*time.Millisecond, "create normal lock with exclusively locked repo didn't return in time") test.OK(t, lock.Unlock())