Skip to content

MockStreamStoreConnection avoids "collection modified" error during disposal#198

Merged
joshkempner merged 3 commits into
masterfrom
joshkempner/mockstreamstore-locks
May 28, 2026
Merged

MockStreamStoreConnection avoids "collection modified" error during disposal#198
joshkempner merged 3 commits into
masterfrom
joshkempner/mockstreamstore-locks

Conversation

@joshkempner
Copy link
Copy Markdown
Contributor

@joshkempner joshkempner commented May 28, 2026

What does this pull request do?
MockStreamStoreConnection avoids "collection modified" error during disposal.

How does this pull request accomplish that goal?
Extends the use of the existing lock to prevent the collection of subscriptions from being modified during disposal.

Why is this pull request important?
This could cause occasional failures in unit tests in projects that rely on MockStreamStoreConnection.

Link to any issues that this resolves
This does not address any open issues.

Checklist

  • All unit tests in the solution must pass on all versions of .NET that the solution supports
  • Any new code must be covered by at least one unit test
  • All public methods must be documented with XML comments

NB
This PR also fixes an issue with the formatting check in the PR build checks, fixes line endings that caused that to fail, and fixes a few flaky tests that at first appeared to be related to the MockStreamStoreConnection change, but turned out to be pre-existing issues.

@joshkempner joshkempner requested a review from condron May 28, 2026 18:47
@joshkempner joshkempner self-assigned this May 28, 2026
@joshkempner joshkempner requested a review from a team as a code owner May 28, 2026 18:47
@joshkempner joshkempner marked this pull request as draft May 28, 2026 19:20
@joshkempner joshkempner force-pushed the joshkempner/mockstreamstore-locks branch 3 times, most recently from 4d3048e to 8749931 Compare May 28, 2026 19:58
@joshkempner joshkempner marked this pull request as ready for review May 28, 2026 20:00
@joshkempner joshkempner changed the base branch from master to joshkempner/format May 28, 2026 20:05
@joshkempner joshkempner force-pushed the joshkempner/mockstreamstore-locks branch from 8749931 to 869bd4e Compare May 28, 2026 20:05
@joshkempner joshkempner mentioned this pull request May 28, 2026
3 tasks
@joshkempner joshkempner changed the base branch from joshkempner/format to master May 28, 2026 20:07
…isposal

- Extends the use of the existing lock to prevent the collection of subscriptions from being modified during disposal.
- Fixes flaky unit tests
@joshkempner joshkempner force-pushed the joshkempner/mockstreamstore-locks branch from 869bd4e to aedf572 Compare May 28, 2026 20:10
@joshkempner joshkempner merged commit e4e0269 into master May 28, 2026
4 checks passed
@joshkempner joshkempner deleted the joshkempner/mockstreamstore-locks branch May 28, 2026 20:41
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.

2 participants