mirror of
https://github.com/garethgeorge/backrest.git
synced 2025-12-12 08:45:38 +00:00
chore: fix scheduler wait test
This commit is contained in:
@@ -153,10 +153,17 @@ func TestSchedulerWait(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create orchestrator: %v", err)
|
||||
}
|
||||
orch.taskQueue.Reset()
|
||||
|
||||
ran := make(chan struct{})
|
||||
didRun := false
|
||||
orch.ScheduleTask(&testTask{
|
||||
onNext: func(t time.Time) *time.Time {
|
||||
t = t.Add(150 * time.Millisecond)
|
||||
if didRun {
|
||||
return nil
|
||||
}
|
||||
t = t.Add(100 * time.Millisecond)
|
||||
didRun = true
|
||||
return &t
|
||||
},
|
||||
onRun: func() error {
|
||||
|
||||
Reference in New Issue
Block a user