1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-26 17:57:50 +00:00

lock: increase test timeout tolerances to avoid test failures

This commit is contained in:
Michael Eischer 2023-04-07 20:03:51 +02:00
parent ea59896bd6
commit 8ce5f29758

View file

@ -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())