Skip to content

Commit

Permalink
Deterministic scheduler tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andresgutierrez committed Oct 16, 2023
1 parent e8f1ba5 commit 9897e7d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Nixie.Tests/TestScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ public async void TestCreatePeriodicTimer()

await Task.Delay(5500);

Assert.True(((PeriodicTimerActor)actor.Runner.Actor!).GetMessages("hello") >= 5);
int numberMessages = ((PeriodicTimerActor)actor.Runner.Actor!).GetMessages("hello");

Assert.Equal(6, numberMessages);
}

[Fact]
Expand All @@ -34,13 +36,13 @@ public async void TestCreatePeriodicTimerExternalStop()

int numberMessages = ((PeriodicTimerActor)actor.Runner.Actor!).GetMessages("hello");

Assert.True(numberMessages == 2 || numberMessages == 3);
Assert.Equal(3, numberMessages);

await Task.Delay(2500);

numberMessages = ((PeriodicTimerActor)actor.Runner.Actor!).GetMessages("hello");

Assert.True(numberMessages == 2 || numberMessages == 3);
Assert.Equal(3, numberMessages);
}

[Fact]
Expand Down

0 comments on commit 9897e7d

Please sign in to comment.