Skip to content

Commit 275b3d3

Browse files
author
Jos Hickson
committed
Allow some latitude for actual delay time.
1 parent eb57149 commit 275b3d3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Winton.Extensions.Threading.Actor.Tests.Unit/Internal/ActorWorkSchedulerTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ public void ShouldBeAbleToScheduleWorkToRepeatAtAFixedInterval(WorkType workType
8989

9090
var actualIntervals = times.Take(sampleSize - 1).Zip(times.Skip(1), (x, y) => y - x).ToList();
9191

92-
actualIntervals.Should().OnlyContain(x => x >= expectedInterval);
92+
// Use 75ms instead of 100ms to give it a bit of latitude: mainly we just want to make sure there is some delaying going on.
93+
actualIntervals.Should().OnlyContain(x => x >= TimeSpan.FromMilliseconds(75));
9394

9495
var expectedNumberOfDelays = sampleSize - (actorScheduleOptions.HasFlag(ActorScheduleOptions.NoInitialDelay) ? 1 : 0);
9596

0 commit comments

Comments
 (0)