Skip to content

Commit

Permalink
fix: timing error in tests (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianhall authored Aug 19, 2024
1 parent fc7cb5c commit fe49650
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ public async Task QueueHandler_WithThreads_Enqueue(int nThreads)
accId.Should().HaveCount(nElements);
accTh.Should().HaveCount(nElements);
accTh.AsEnumerable().Distinct().Should().HaveCount(nThreads);
(endTime - startTime).TotalSeconds.Should().BeLessThanOrEqualTo((nElements / nThreads) + 2);
// This just makes sure that the amount of time is "of the right order of magnitude" since CI systems
// are notoriously bad at correct timings. We just don't want it to be 10x the expected time.
(endTime - startTime).TotalSeconds.Should().BeLessThanOrEqualTo((nElements / nThreads) + 5);
}

[Theory(Timeout = 30000)]
Expand Down

0 comments on commit fe49650

Please sign in to comment.