diff --git a/BitFaster.Caching.UnitTests/Buffers/MpmcBoundedBufferSoakTests.cs b/BitFaster.Caching.UnitTests/Buffers/MpmcBoundedBufferSoakTests.cs index 4a119269..21dd8810 100644 --- a/BitFaster.Caching.UnitTests/Buffers/MpmcBoundedBufferSoakTests.cs +++ b/BitFaster.Caching.UnitTests/Buffers/MpmcBoundedBufferSoakTests.cs @@ -11,6 +11,7 @@ namespace BitFaster.Caching.UnitTests.Buffers [Collection("Soak")] public class MpmcBoundedBufferSoakTests { + private const int SoakIterations = 10; private readonly ITestOutputHelper testOutputHelper; private static readonly TimeSpan Timeout = TimeSpan.FromSeconds(30); @@ -22,7 +23,7 @@ public MpmcBoundedBufferSoakTests(ITestOutputHelper testOutputHelper) } [Theory] - [Repeat(10)] + [Repeat(SoakIterations)] public async Task WhenAddIsContendedBufferCanBeFilled(int iteration) { this.testOutputHelper.WriteLine($"Iteration {iteration}"); @@ -37,9 +38,11 @@ await Threaded.Run(4, () => }); } - [Fact] - public async Task WhileBufferIsFilledItemsCanBeTaken() + [Theory] + [Repeat(SoakIterations)] + public async Task WhileBufferIsFilledItemsCanBeTaken(int iteration) { + this.testOutputHelper.WriteLine($"Iteration {iteration}"); this.testOutputHelper.WriteLine($"ProcessorCount={Environment.ProcessorCount}."); var fill = CreateParallelFill(buffer, threads: 4, itemsPerThread: 256); @@ -66,9 +69,11 @@ public async Task WhileBufferIsFilledItemsCanBeTaken() await take.TimeoutAfter(Timeout, "take timed out"); } - [Fact] - public async Task WhileBufferIsFilledCountCanBeTaken() + [Theory] + [Repeat(SoakIterations)] + public async Task WhileBufferIsFilledCountCanBeTaken(int iteration) { + this.testOutputHelper.WriteLine($"Iteration {iteration}"); this.testOutputHelper.WriteLine($"ProcessorCount={Environment.ProcessorCount}."); var fill = CreateParallelFill(buffer, threads: 4, itemsPerThread: 256);