2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-23 03:18:55 +00:00

lock: Tweak timeouts for lock refresh test

For some reason the test fails from time to time. Increase the timeouts
to hopefully avoid this issue.
This commit is contained in:
Michael Eischer 2022-11-04 22:48:18 +01:00
parent 8dd95b710e
commit aaac63da8d

View File

@ -133,10 +133,11 @@ func TestLockSuccessfulRefresh(t *testing.T) {
repo, cleanup, _ := openTestRepo(t, nil) repo, cleanup, _ := openTestRepo(t, nil)
defer cleanup() defer cleanup()
t.Log("test for successful lock refresh")
// reduce locking intervals to be suitable for testing // reduce locking intervals to be suitable for testing
ri, rt := refreshInterval, refreshabilityTimeout ri, rt := refreshInterval, refreshabilityTimeout
refreshInterval = 20 * time.Millisecond refreshInterval = 40 * time.Millisecond
refreshabilityTimeout = 100 * time.Millisecond refreshabilityTimeout = 200 * time.Millisecond
defer func() { defer func() {
refreshInterval, refreshabilityTimeout = ri, rt refreshInterval, refreshabilityTimeout = ri, rt
}() }()