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

Merge pull request #4008 from MichaelEischer/tweak-lock-refresh-test

lock: Tweak timeouts for lock refresh test
This commit is contained in:
Michael Eischer 2022-11-05 10:53:13 +01:00 committed by GitHub
commit 24a2e5cab9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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