Skip to content

Commit 3835139

Browse files
committed
refactor: Made test more robust
1 parent e33f053 commit 3835139

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/NCronJob.Tests/NCronJobIntegrationTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,14 +466,14 @@ public async Task AddingJobsAndDuringStartupAndRuntimeNotInOnlyOneCallOnlyOneExe
466466
[Fact]
467467
public async Task CallingAddNCronJobMultipleTimesWillRegisterAllJobs()
468468
{
469-
ServiceCollection.AddNCronJob(n => n.AddJob<ShortRunningJob>());
469+
ServiceCollection.AddNCronJob(n => n.AddJob<ShortRunningJob>(p => p.WithCronExpression("* * * * *")));
470470
ServiceCollection.AddNCronJob(n => n.AddJob<SimpleJob>(p => p.WithCronExpression("* * * * *")));
471471
var provider = CreateServiceProvider();
472472

473473
await provider.GetRequiredService<IHostedService>().StartAsync(CancellationToken);
474474

475475
FakeTimer.Advance(TimeSpan.FromMinutes(1));
476-
var jobFinished = await WaitForJobsOrTimeout(1);
476+
var jobFinished = await WaitForJobsOrTimeout(2);
477477
jobFinished.ShouldBeTrue();
478478
}
479479

0 commit comments

Comments
 (0)