mirror of
https://github.com/rclone/rclone.git
synced 2026-10-20 18:44:46 -04:00
lib/cache,rc/jobs: make tests more reliable
This commit is contained in:
1 parent
08b86cc94b
commit
b242b0a078
2 files changed
+2
-2
No files matched your search
@@ -51,7 +51,7 @@ func TestJobsExpire(t *testing.T) {
|
||||
assert.Equal(t, true, jobs.expireRunning)
|
||||
job.mu.Unlock()
|
||||
jobs.mu.Unlock()
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
time.Sleep(250 * time.Millisecond)
|
||||
jobs.mu.Lock()
|
||||
assert.Equal(t, false, jobs.expireRunning)
|
||||
assert.Equal(t, 0, len(jobs.jobs))
|
||||
|
||||
Vendored
+1
-1
@@ -115,7 +115,7 @@ func TestCacheExpire(t *testing.T) {
|
||||
entry.lastUsed = time.Now().Add(-c.expireDuration - 60*time.Second)
|
||||
assert.Equal(t, true, c.expireRunning)
|
||||
c.mu.Unlock()
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
time.Sleep(250 * time.Millisecond)
|
||||
c.mu.Lock()
|
||||
assert.Equal(t, false, c.expireRunning)
|
||||
assert.Equal(t, 0, len(c.cache))
|
||||
|
||||
Reference in new issue
Block a user