The Web tests' shared host can lose its UDP listener on Windows because its port is checked for TCP only #384

Closed
opened 2026-11-12 11:46:48 -05:00 by claude · 0 comments
Owner

Six Ninlil.Web.Tests failed in the Windows test job of the develop push run 1485 (f0c65968), the run that gates the release cut. The same code passed in run 1477, so the failure is intermittent. Test code only; no product defect.

Failure

  • ServicesControllerCrudTests.List_WithAnAuthenticatedCaller_ReturnsEveryRegisteredService and Stop_OnThePlainUdpTransport_ActuallyStopsAnsweringRealQueries_AndStartResumes: plain-udp is not running.
  • RewriteCnameChaseEndToEndTests, FilterListEndToEndTests, DnsWiringTests and AccessControlRuleEndToEndTests (one test each): the UDP query gets "An existing connection was forcibly closed by the remote host", which is what Windows reports when nothing listens on the UDP port.

Cause

  • NinlilDnsWebApplicationFactory.GetFreePort asks for a port-0 TCP port on loopback and gives that number to the Plain DNS listener, which binds it for TCP and UDP.
  • Windows keeps separate excluded port ranges per protocol. On lofnheim 600 of the 16,384 dynamic ports are excluded for UDP only (51915-52014 and 63720-64219). Checked there: ports 51920, 63800 and 64100 bind for TCP on loopback and are refused for UDP with AccessDenied (10013).
  • When the pick lands in such a range, the UDP listener cannot bind, the host keeps running without it, and every test that needs a UDP answer fails. That is about 1 run in 27.
  • StartupRefusalProcessTests has its own copy of the same TCP-only helper.

Fix

  • Pick a random port in the dynamic range and bind it for TCP and UDP on loopback before handing it out, the approach #374 took for the secondary forwarder test. Both classes use the one helper.

Done when

  • The Web tests pass on Windows and Linux, and a port that is refused for UDP is never handed to the shared host.
Six `Ninlil.Web.Tests` failed in the Windows test job of the `develop` push run 1485 (`f0c65968`), the run that gates the release cut. The same code passed in run 1477, so the failure is intermittent. Test code only; no product defect. **Failure** - `ServicesControllerCrudTests.List_WithAnAuthenticatedCaller_ReturnsEveryRegisteredService` and `Stop_OnThePlainUdpTransport_ActuallyStopsAnsweringRealQueries_AndStartResumes`: `plain-udp` is not running. - `RewriteCnameChaseEndToEndTests`, `FilterListEndToEndTests`, `DnsWiringTests` and `AccessControlRuleEndToEndTests` (one test each): the UDP query gets "An existing connection was forcibly closed by the remote host", which is what Windows reports when nothing listens on the UDP port. **Cause** - `NinlilDnsWebApplicationFactory.GetFreePort` asks for a port-0 TCP port on loopback and gives that number to the Plain DNS listener, which binds it for TCP and UDP. - Windows keeps separate excluded port ranges per protocol. On lofnheim 600 of the 16,384 dynamic ports are excluded for UDP only (51915-52014 and 63720-64219). Checked there: ports 51920, 63800 and 64100 bind for TCP on loopback and are refused for UDP with `AccessDenied` (10013). - When the pick lands in such a range, the UDP listener cannot bind, the host keeps running without it, and every test that needs a UDP answer fails. That is about 1 run in 27. - `StartupRefusalProcessTests` has its own copy of the same TCP-only helper. **Fix** - Pick a random port in the dynamic range and bind it for TCP and UDP on loopback before handing it out, the approach #374 took for the secondary forwarder test. Both classes use the one helper. **Done when** - The Web tests pass on Windows and Linux, and a port that is refused for UDP is never handed to the shared host.
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#384
No description provided.