Skip to content

Commit

Permalink
fix filing test
Browse files Browse the repository at this point in the history
  • Loading branch information
GiampaoloGabba committed Apr 9, 2024
1 parent 66ba95b commit dbb3576
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,15 @@ public async Task Should_execute_recurring_cron()

var task = new TestTaskDelayed2();
TestTaskDelayed2.Counter = 0;
await _dispatcher.Dispatch(task, builder => builder.RunDelayed(TimeSpan.FromSeconds(0.4)).Then().UseCron("*/2 * * * * *").MaxRuns(3));
await _dispatcher.Dispatch(task, builder => builder.RunDelayed(TimeSpan.FromMilliseconds(600)).Then().UseCron("*/2 * * * * *").MaxRuns(3));

await Task.Delay(100);

var pt = await _storage.GetAll();
pt.Length.ShouldBe(1);
pt[0].Status.ShouldBe(QueuedTaskStatus.WaitingQueue);

await Task.Delay(600);
pt = await _storage.GetAll();
//pt[0].CurrentRunCount.ShouldBe(1);

await Task.Delay(6000);
await Task.Delay(7000);
pt = await _storage.GetAll();
pt.Length.ShouldBe(1);
pt[0].CurrentRunCount.ShouldBe(3);
Expand Down

0 comments on commit dbb3576

Please sign in to comment.