Skip to content

Commit

Permalink
lock: increase test timeout tolerances to avoid test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelEischer committed Apr 7, 2023
1 parent ea59896 commit fcf3c02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/restic/lock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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())
Expand Down

0 comments on commit fcf3c02

Please sign in to comment.