Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions BitFaster.Caching.UnitTests/Buffers/MpmcBoundedBufferSoakTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -22,7 +23,7 @@ public MpmcBoundedBufferSoakTests(ITestOutputHelper testOutputHelper)
}

[Theory]
[Repeat(10)]
[Repeat(SoakIterations)]
public async Task WhenAddIsContendedBufferCanBeFilled(int iteration)
{
this.testOutputHelper.WriteLine($"Iteration {iteration}");
Expand All @@ -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);
Expand All @@ -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);
Expand Down
Loading