Bind-failure tests check the failure the same way on Windows and Linux #10

Closed
opened 2026-10-31 12:41:49 -04:00 by claude · 0 comments
Owner
  • Draft: REL-4
  • Priority: low (test-only)
  • Agent: coder
  • Depends on: none
  • Decisions: none

Why

The tests occupy a port and assert that the logged reason or health text contains "in use". On
Windows the bind fails with "An attempt was made to access a socket in a way forbidden by its
access permissions" (WSAEACCES), because the occupying socket is exclusive. The product logs the
OS message as it should; the assertion is Linux-specific.

What changes

Tests only: Dhcpv4ListenerBindFailureTests, Dhcpv6ListenerBindFailureTests
(src/dotnet/tests/Ninlil.Dhcp.Protocol.Dhcpv4.Tests, ...Dhcpv6.Tests),
TftpServerBindFailureTests (Ninlil.Dhcp.Server.Tftp.Tests),
TransportListenersHealthCheckTests and DhcpServiceHealthCheckTests (Ninlil.Web.Tests),
ListenSocketSetTests Tcp and Udp variants (Ninlil.Dns.Server.Core.Tests/Transport). Assert on
the message of the SocketException the occupant bind would produce on this OS (take it from the
exception the test provokes, or accept AddressAlreadyInUse or AccessDenied texts from
new SocketException((int)error).Message), not a fixed English phrase. The DHCP ones may instead
return early on non-Linux if #11 marks DHCP Linux-only; say which.

Acceptance

  • The 7 tests pass on Lofnheim natively and still pass on Linux (each project by path).
  • Each changed test still fails if the product stops including the OS reason (show by
    temporarily blanking the reason: an assertion failure).

Source

RP-4 report finding 3 ("Port-taken tests"); release-prep.md:159.

- **Draft:** REL-4 - **Priority:** low (test-only) - **Agent:** coder - **Depends on:** none - **Decisions:** none ### Why The tests occupy a port and assert that the logged reason or health text contains "in use". On Windows the bind fails with "An attempt was made to access a socket in a way forbidden by its access permissions" (WSAEACCES), because the occupying socket is exclusive. The product logs the OS message as it should; the assertion is Linux-specific. ### What changes Tests only: `Dhcpv4ListenerBindFailureTests`, `Dhcpv6ListenerBindFailureTests` (`src/dotnet/tests/Ninlil.Dhcp.Protocol.Dhcpv4.Tests`, `...Dhcpv6.Tests`), `TftpServerBindFailureTests` (`Ninlil.Dhcp.Server.Tftp.Tests`), `TransportListenersHealthCheckTests` and `DhcpServiceHealthCheckTests` (`Ninlil.Web.Tests`), `ListenSocketSetTests` Tcp and Udp variants (`Ninlil.Dns.Server.Core.Tests/Transport`). Assert on the message of the `SocketException` the occupant bind would produce on this OS (take it from the exception the test provokes, or accept `AddressAlreadyInUse` or `AccessDenied` texts from `new SocketException((int)error).Message`), not a fixed English phrase. The DHCP ones may instead return early on non-Linux if #11 marks DHCP Linux-only; say which. ### Acceptance - [ ] The 7 tests pass on Lofnheim natively and still pass on Linux (each project by path). - [ ] Each changed test still fails if the product stops including the OS reason (show by temporarily blanking the reason: an assertion failure). ### Source RP-4 report finding 3 ("Port-taken tests"); `release-prep.md:159`.
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.

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