The last reserve-and-release port tests are converted in one dedicated pass #233

Closed
opened 2026-10-31 12:42:31 -04:00 by claude · 0 comments
Owner
  • Draft: BUG-47
  • Priority: low (the owner's final pass after the convert-when-touched rule)
  • Agent: coder
  • Depends on: #54
  • Decisions: Q-BUG-8

Why

#54 makes contributors convert a test project when they touch it. Whatever is left at the end is converted here, so the flake source is gone for good. At HEAD 41 test files (124 call sites) use GetFreeUdpPort/GetFreeTcpPort/GetFreePort; examples: src/dotnet/tests/Ninlil.Dhcp.Server.Relay.Tests/Dhcpv4RelayAgentTests.cs, src/dotnet/tests/Ninlil.Dns.Protocol.DnsOverTls.Tests/DnsOverTlsListenerTests.cs, src/dotnet/tests/Ninlil.Dns.Server.Core.Tests/Transport/ListenSocketSetTests.cs.

What changes

  • First list the files still using the pattern (grep -rln "GetFree\(Udp\|Tcp\)\?Port" src/dotnet/tests). If more than one dispatch's worth remains, split this issue into one child per test project family before starting.
  • Per project: where the server exposes its bound port (or can, through an internal member visible to tests), start on port 0 and read it. Elsewhere, add a bounded retry on AddressInUse, with a comment saying why.
  • NinlilDnsWebApplicationFactory env-var ports stay as they are.
  • Delete the reserve-and-release helpers once nothing calls them.

Acceptance

  • Per converted project: a scratch injection that steals the reserved port makes the old test fail 5/5 and the new one pass 5/5 (notes in the PR).
  • Each converted project passes 10 runs in a row.
  • The grep above finds nothing (or each remaining use is justified).

Source

b23-design.md:467 (B23-13 note).
Owner decision 2026-10-31 (Q-BUG-8): "a final dedicated pass issue at the end".

- **Draft:** BUG-47 - **Priority:** low (the owner's final pass after the convert-when-touched rule) - **Agent:** coder - **Depends on:** #54 - **Decisions:** Q-BUG-8 ### Why #54 makes contributors convert a test project when they touch it. Whatever is left at the end is converted here, so the flake source is gone for good. At HEAD 41 test files (124 call sites) use `GetFreeUdpPort`/`GetFreeTcpPort`/`GetFreePort`; examples: `src/dotnet/tests/Ninlil.Dhcp.Server.Relay.Tests/Dhcpv4RelayAgentTests.cs`, `src/dotnet/tests/Ninlil.Dns.Protocol.DnsOverTls.Tests/DnsOverTlsListenerTests.cs`, `src/dotnet/tests/Ninlil.Dns.Server.Core.Tests/Transport/ListenSocketSetTests.cs`. ### What changes - First list the files still using the pattern (`grep -rln "GetFree\(Udp\|Tcp\)\?Port" src/dotnet/tests`). If more than one dispatch's worth remains, split this issue into one child per test project family before starting. - Per project: where the server exposes its bound port (or can, through an internal member visible to tests), start on port 0 and read it. Elsewhere, add a bounded retry on `AddressInUse`, with a comment saying why. - `NinlilDnsWebApplicationFactory` env-var ports stay as they are. - Delete the reserve-and-release helpers once nothing calls them. ### Acceptance - [ ] Per converted project: a scratch injection that steals the reserved port makes the old test fail 5/5 and the new one pass 5/5 (notes in the PR). - [ ] Each converted project passes 10 runs in a row. - [ ] The grep above finds nothing (or each remaining use is justified). ### Source `b23-design.md:467` (B23-13 note). Owner decision 2026-10-31 (Q-BUG-8): "a final dedicated pass issue at the end".
claude added this to the (deleted) milestone 2026-10-31 12:42:31 -04:00
claude removed this from the (deleted) milestone 2026-11-06 12:28:38 -05:00
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#233
No description provided.