The event-bus test for broker events from another instance no longer fails at random in CI #267

Closed
opened 2026-11-04 23:27:15 -05:00 by claude · 0 comments
Owner
  • Draft: none (found by the main session while checking PR #266)
  • Priority: high (it turns the Test .NET job red on develop and on unrelated pull requests)
  • Agent: coder
  • Depends on: none
  • Decisions: none

Why

Ninlil.Dns.Server.Core.Tests.EventBus.DnsServerEventBusTests.ReceiveFromBroker_OfAnotherInstancesEvent_ReachesOnlyRemoteAwareSubscribers
fails intermittently in CI and passes locally (5 of 5 runs). It failed the Test .NET job of the
push run on develop at 7fee823d (runner asgard, task 4327) and, very likely, of PR #266's run 969:

Failed ...ReceiveFromBroker_OfAnotherInstancesEvent_ReachesOnlyRemoteAwareSubscribers [18 ms]
Assert.Single() Failure: The collection was empty
at .../Ninlil.Dns.Server.Core.Tests/Events/DnsServerEventBusTests.cs:line 90

Line 90 is Assert.Single(bus.Remote.Zones): the drain marker was seen before the remote zone
event reached the remote-aware subscriber. On paper the order holds (BrokerEventConsumerService.HandleEnvelope
enqueues into the control channel synchronously, the dispatcher reads control before lossy, and the
marker is lossy), so the race is somewhere less obvious: in the fake transport's callback, the
consumer's start-up, LocalSubscriber.ArmMarker/MarkerSeen, or a stale marker.

What changes

Find the race (reproduce under load, for example stress or many parallel runs), fix its cause in
the test harness or the bus, and say in a comment why the order now holds. Do not paper over it
with a longer wait or a retry.

Acceptance

  • The cause is named in the PR description.
  • The test passes 200 runs in a row under CPU load.
  • dotnet test src/dotnet/tests/Ninlil.Dns.Server.Core.Tests passes.
- **Draft:** none (found by the main session while checking PR #266) - **Priority:** high (it turns the Test .NET job red on develop and on unrelated pull requests) - **Agent:** coder - **Depends on:** none - **Decisions:** none ### Why `Ninlil.Dns.Server.Core.Tests.EventBus.DnsServerEventBusTests.ReceiveFromBroker_OfAnotherInstancesEvent_ReachesOnlyRemoteAwareSubscribers` fails intermittently in CI and passes locally (5 of 5 runs). It failed the Test .NET job of the push run on develop at 7fee823d (runner asgard, task 4327) and, very likely, of PR #266's run 969: ``` Failed ...ReceiveFromBroker_OfAnotherInstancesEvent_ReachesOnlyRemoteAwareSubscribers [18 ms] Assert.Single() Failure: The collection was empty at .../Ninlil.Dns.Server.Core.Tests/Events/DnsServerEventBusTests.cs:line 90 ``` Line 90 is `Assert.Single(bus.Remote.Zones)`: the drain marker was seen before the remote zone event reached the remote-aware subscriber. On paper the order holds (`BrokerEventConsumerService.HandleEnvelope` enqueues into the control channel synchronously, the dispatcher reads control before lossy, and the marker is lossy), so the race is somewhere less obvious: in the fake transport's callback, the consumer's start-up, `LocalSubscriber.ArmMarker`/`MarkerSeen`, or a stale marker. ### What changes Find the race (reproduce under load, for example `stress` or many parallel runs), fix its cause in the test harness or the bus, and say in a comment why the order now holds. Do not paper over it with a longer wait or a retry. ### Acceptance - [ ] The cause is named in the PR description. - [ ] The test passes 200 runs in a row under CPU load. - [ ] `dotnet test src/dotnet/tests/Ninlil.Dns.Server.Core.Tests` passes.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil#267
No description provided.