Skip to content

Tests: count the channel rig's executes atomically - #167

Merged
electricessence merged 1 commit into
masterfrom
fix/channel-rig-executes-race
Nov 16, 2026
Merged

electricessence merged 1 commit into
masterfrom
fix/channel-rig-executes-race

Conversation

@electricessence

Copy link
Copy Markdown
Collaborator

MappedToChannelReaderTests.EveryRung_DeliversTheRowsInOrder_AndCompletes failed on master and on #161 with "Expected: 5, Actual: 4".

The test starts two feeds at once (startImmediately: true), so two readers can be created on different threads. The rig counted them with a plain Executes++, which can lose an increment. The rows were right; only the test's count was off.

The count is now Interlocked.Increment, read with Volatile.Read. Tests only; the library is unchanged.

Local check: the channel tests (580) ran 20 rounds in a row on net10.0 Release with no failure.

🤖 Generated with Claude Code

The every-rung channel test starts two feeds at once, so two
readers can be created on different threads. The rig counted
them with a plain increment, which can lose one: CI saw 4 of 5
on master. The count is now an Interlocked increment read with
Volatile.Read. The library is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@electricessence
electricessence merged commit 8e08102 into master Nov 16, 2026
7 checks passed
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.

1 participant