Skip to content

Repeat Mpmc bounded buffer soak tests for fill-and-take scenarios#786

Merged
bitfaster merged 1 commit intomainfrom
copilot/update-mpmc-bounded-buffer-tests
Apr 20, 2026
Merged

Repeat Mpmc bounded buffer soak tests for fill-and-take scenarios#786
bitfaster merged 1 commit intomainfrom
copilot/update-mpmc-bounded-buffer-tests

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 20, 2026

The MPMC soak coverage was inconsistent: WhenAddIsContendedBufferCanBeFilled already ran 10 iterations, while the two concurrent fill-and-take scenarios ran once. This aligns those soak tests so the key buffer-fill contention paths execute with the same repetition.

  • What changed

    • Converted WhileBufferIsFilledItemsCanBeTaken from a single-run [Fact] to a repeated [Theory]
    • Converted WhileBufferIsFilledCountCanBeTaken from a single-run [Fact] to a repeated [Theory]
    • Reused a shared SoakIterations constant so all three MPMC soak tests stay in sync
    • Added per-iteration output to the updated tests for parity with the existing contended-add soak test
  • Result

    • The MPMC soak suite now exercises:
      • add contention
      • concurrent fill + take
      • concurrent fill + count
    • each for 10 iterations instead of only repeating the add-contention case
  • Example

    [Theory]
    [Repeat(SoakIterations)]
    public async Task WhileBufferIsFilledItemsCanBeTaken(int iteration)
    {
        this.testOutputHelper.WriteLine($"Iteration {iteration}");
        // existing soak logic
    }

Agent-Logs-Url: https://github.com/bitfaster/BitFaster.Caching/sessions/b9ca3364-1ffb-4970-944d-6d63673254be

Co-authored-by: bitfaster <12851828+bitfaster@users.noreply.github.com>
@bitfaster bitfaster marked this pull request as ready for review April 20, 2026 07:27
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 99.08% (-0.03%) from 99.11% — copilot/update-mpmc-bounded-buffer-tests into main

@bitfaster bitfaster merged commit b9b1c39 into main Apr 20, 2026
16 checks passed
@bitfaster bitfaster deleted the copilot/update-mpmc-bounded-buffer-tests branch April 20, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants