forked from TrueCloudLab/rclone
rc: fix race in tests
This commit is contained in:
parent
49d2ab512d
commit
577fda059d
1 changed files with 2 additions and 0 deletions
|
@ -43,8 +43,10 @@ func TestJobsExpire(t *testing.T) {
|
|||
jobs.Expire()
|
||||
assert.Equal(t, 1, len(jobs.jobs))
|
||||
jobs.mu.Lock()
|
||||
job.mu.Lock()
|
||||
job.EndTime = time.Now().Add(-expireDuration - 60*time.Second)
|
||||
assert.Equal(t, true, jobs.expireRunning)
|
||||
job.mu.Unlock()
|
||||
jobs.mu.Unlock()
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
jobs.mu.Lock()
|
||||
|
|
Loading…
Reference in a new issue