The Web tests give their shared host a port that is free for both TCP and UDP #385

Merged
claude merged 3 commits from feature/384-web-tests-udp-free-port into develop 2026-11-12 15:08:24 -05:00
Owner

The Web tests' shared host no longer loses its Plain DNS UDP listener on Windows. Test code only; no product change.

  • Failure: six Ninlil.Web.Tests failed in the Windows job of develop run 1485 (plain-udp not running; UDP queries reset). The same code passed in run 1477.
  • Cause: NinlilDnsWebApplicationFactory.GetFreePort took a port-0 TCP port and gave it to a listener that binds TCP and UDP. Windows excludes 600 of lofnheim's 16,384 dynamic ports for UDP only; checked there, ports 51920, 63800 and 64100 bind for TCP and are refused for UDP (10013). A pick in such a range leaves the host without its UDP listener.
  • Fix: the helper picks a random port in the dynamic range and binds TCP and UDP on loopback before handing it out (up to 2000 picks). StartupRefusalProcessTests drops its copy and uses the same helper.

Verified

  • Linux: Ninlil.Web.Tests 2353 of 2353; the build has 0 warnings and csharpier is clean.
  • Windows (lofnheim) and the verifier's result are in the comment below.

Also in this pull request

  • The client list test for the last-seen time no longer fails when the clock ticks between the fixture's read and the component's (#387). It failed once, in the push run of this branch, and would block the same pipelines.

Closes #384
Closes #387

🤖 Generated with Claude Code

https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK

The Web tests' shared host no longer loses its Plain DNS UDP listener on Windows. Test code only; no product change. - **Failure:** six `Ninlil.Web.Tests` failed in the Windows job of `develop` run 1485 (`plain-udp` not running; UDP queries reset). The same code passed in run 1477. - **Cause:** `NinlilDnsWebApplicationFactory.GetFreePort` took a port-0 TCP port and gave it to a listener that binds TCP and UDP. Windows excludes 600 of lofnheim's 16,384 dynamic ports for UDP only; checked there, ports 51920, 63800 and 64100 bind for TCP and are refused for UDP (10013). A pick in such a range leaves the host without its UDP listener. - **Fix:** the helper picks a random port in the dynamic range and binds TCP and UDP on loopback before handing it out (up to 2000 picks). `StartupRefusalProcessTests` drops its copy and uses the same helper. **Verified** - Linux: `Ninlil.Web.Tests` 2353 of 2353; the build has 0 warnings and csharpier is clean. - Windows (lofnheim) and the verifier's result are in the comment below. **Also in this pull request** - The client list test for the last-seen time no longer fails when the clock ticks between the fixture's read and the component's (#387). It failed once, in the push run of this branch, and would block the same pipelines. Closes #384 Closes #387 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
The Web tests give their shared host a port that is free for both TCP and UDP, so its UDP listener always starts on Windows
All checks were successful
Build / Smoke Test the Windows Binary (push) Successful in 16s
Build / Build and Test Deb and RPM Packages (push) Successful in -29s
Build / Compute Version (pull_request) Successful in -2m34s
Build / Lint and Script Tests (pull_request) Successful in -1m48s
Build / Windows Test Gate (pull_request) Successful in -2m37s
Build / Build Binary (windows-amd64) (push) Successful in -1m30s
Build / Build Arch Linux Packages (push) Successful in -2m0s
Build / Build and Push Image (push) Successful in -2m31s
Build / Publish Release (push) Successful in -2m33s
Build / Pipeline (push) Successful in 0s
Build / Test .NET on Windows (pull_request) Has been skipped
Build / Test Admin Console (pull_request) Successful in -1m15s
Build / Test .NET (pull_request) Successful in 5m17s
Build / Build Binary (linux-amd64) (pull_request) Successful in -59s
Build / Build Binary (linux-arm64) (pull_request) Successful in -1m5s
Build / Build Binary (macos-amd64) (pull_request) Successful in -44s
Build / Build Binary (macos-arm64) (pull_request) Successful in -54s
Build / Stage Draft Release (pull_request) Successful in -2m35s
Build / Pack and Push NuGet Packages (common) (pull_request) Successful in -2m28s
Build / Pack and Push NuGet Packages (dhcp) (pull_request) Successful in -2m14s
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Successful in -2m11s
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Successful in -2m1s
Build / Build Binary (windows-amd64) (pull_request) Successful in -1m31s
Build / Build Arch Linux Packages (pull_request) Successful in -2m0s
Build / Publish Release (pull_request) Successful in -2m33s
Build / Smoke Test the Windows Binary (pull_request) Successful in 15s
Build / Build and Push Image (pull_request) Successful in -1m58s
Build / Build and Test Deb and RPM Packages (pull_request) Successful in -14s
Build / Pipeline (pull_request) Successful in 0s
Build / Build Binary (macos-arm64) (push) Successful in -46s
3de8f0c6ae
Windows excludes some dynamic ports for UDP only. A port-0 TCP pick inside such a range left the host without its Plain DNS UDP listener, and six tests that need a UDP answer failed. The factory now picks at random from the dynamic range and binds TCP and UDP on loopback before it hands the number out; the startup refusal tests use the same helper.

Closes #384

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
The comment on the Web test host's listener ports says they are free for TCP and UDP
Some checks failed
Build / Build Binary (macos-arm64) (push) Has been skipped
Build / Build Binary (windows-amd64) (push) Has been skipped
Build / Build Arch Linux Packages (push) Has been skipped
Build / Smoke Test the Windows Binary (push) Has been skipped
Build / Build and Test Deb and RPM Packages (push) Has been skipped
Build / Build and Push Image (push) Has been skipped
Build / Publish Release (push) Has been skipped
Build / Pipeline (push) Failing after 0s
Build / Pipeline (pull_request) Has been cancelled
Build / Compute Version (pull_request) Has been cancelled
Build / Test .NET (pull_request) Has been cancelled
Build / Test Admin Console (pull_request) Has been cancelled
Build / Lint and Script Tests (pull_request) Has been cancelled
Build / Stage Draft Release (pull_request) Has been cancelled
Build / Build Binary (linux-amd64) (pull_request) Has been cancelled
Build / Build Binary (linux-arm64) (pull_request) Has been cancelled
Build / Build Binary (macos-amd64) (pull_request) Has been cancelled
Build / Build Binary (macos-arm64) (pull_request) Has been cancelled
Build / Build Binary (windows-amd64) (pull_request) Has been cancelled
Build / Build Arch Linux Packages (pull_request) Has been cancelled
Build / Build and Test Deb and RPM Packages (pull_request) Has been cancelled
Build / Build and Push Image (pull_request) Has been cancelled
Build / Pack and Push NuGet Packages (common) (pull_request) Has been cancelled
Build / Pack and Push NuGet Packages (dhcp) (pull_request) Has been cancelled
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Has been cancelled
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Has been cancelled
Build / Smoke Test the Windows Binary (pull_request) Has been cancelled
Build / Test .NET on Windows (pull_request) Has been cancelled
Build / Windows Test Gate (pull_request) Has been cancelled
Build / Publish Release (pull_request) Has been cancelled
2e1bbfe805
Refs #384

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Author
Owner

Verification

  • Windows (lofnheim), commit 3de8f0c6: Ninlil.Web.Tests 2353 of 2353. The push run of that commit (1486) is green on every job, including the Windows tests and the Windows smoke test.
  • Verifier: accepted with one finding, a comment sentence in the factory that the edit had left without a subject. Commit 2e1bbfe8 rewords it (comment only). It also confirmed that the other port helpers in the project feed single-protocol listeners (TransportSettingsHotReloadTests starts only the DNSCrypt UDP listener; SelfUpdateControllerTests only TCP; DHCP only UDP).
  • Pull-request run 1487, attempt 1, failed in the Linux test job for a reason outside this change: Docker found a host port taken that the MongoDB replica set test host had reserved (21 tests of Ninlil.Dns.Data.Integration.Tests). Filed as #386; the run was started again.
  • One green Windows run does not prove a 1-in-27 failure gone. The proof is the bind check on lofnheim: the excluded ports bind for TCP and are refused for UDP, and the helper now binds both before it hands a number out.
**Verification** - Windows (lofnheim), commit `3de8f0c6`: `Ninlil.Web.Tests` 2353 of 2353. The push run of that commit (1486) is green on every job, including the Windows tests and the Windows smoke test. - Verifier: accepted with one finding, a comment sentence in the factory that the edit had left without a subject. Commit `2e1bbfe8` rewords it (comment only). It also confirmed that the other port helpers in the project feed single-protocol listeners (`TransportSettingsHotReloadTests` starts only the DNSCrypt UDP listener; `SelfUpdateControllerTests` only TCP; DHCP only UDP). - Pull-request run 1487, attempt 1, failed in the Linux test job for a reason outside this change: Docker found a host port taken that the MongoDB replica set test host had reserved (21 tests of `Ninlil.Dns.Data.Integration.Tests`). Filed as #386; the run was started again. - One green Windows run does not prove a 1-in-27 failure gone. The proof is the bind check on lofnheim: the excluded ports bind for TCP and are refused for UDP, and the helper now binds both before it hands a number out.
The client list test for the last-seen time no longer fails when the clock ticks between the fixture's read and the component's
All checks were successful
Build / Publish Release (push) Successful in -2m33s
Build / Pipeline (push) Successful in 0s
Build / Build and Test Deb and RPM Packages (pull_request) Successful in -36s
Build / Publish Release (pull_request) Successful in -2m33s
Build / Pipeline (pull_request) Successful in 0s
Build / Pack and Push NuGet Packages (dhcp) (push) Successful in -2m9s
Build / Pack and Push NuGet Packages (dns-server) (push) Successful in -2m5s
Build / Pack and Push NuGet Packages (dns-core) (push) Successful in -2m5s
Build / Build Binary (linux-amd64) (push) Successful in -1m12s
Build / Build Binary (linux-arm64) (push) Successful in -1m11s
Build / Build Binary (macos-amd64) (push) Successful in -35s
Build / Build Binary (macos-arm64) (push) Successful in -1m0s
Build / Stage Draft Release (pull_request) Successful in -2m35s
Build / Pack and Push NuGet Packages (common) (pull_request) Successful in -2m25s
Build / Pack and Push NuGet Packages (dhcp) (pull_request) Successful in -1m58s
Build / Build Binary (windows-amd64) (push) Successful in -1m16s
Build / Smoke Test the Windows Binary (push) Successful in 15s
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Successful in -2m3s
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Successful in -2m11s
Build / Build Binary (linux-amd64) (pull_request) Successful in -1m21s
Build / Build Binary (linux-arm64) (pull_request) Successful in -1m5s
Build / Build Binary (macos-arm64) (pull_request) Successful in -1m3s
Build / Build Arch Linux Packages (push) Successful in -1m57s
Build / Build Binary (macos-amd64) (pull_request) Successful in -1m11s
Build / Build Binary (windows-amd64) (pull_request) Successful in -56s
Build / Build and Push Image (push) Successful in -2m31s
Build / Build and Test Deb and RPM Packages (push) Successful in -28s
Build / Smoke Test the Windows Binary (pull_request) Successful in 15s
Build / Build Arch Linux Packages (pull_request) Successful in -2m21s
Build / Build and Push Image (pull_request) Successful in -2m31s
4f892caff9
The fixture device was last seen exactly five minutes ago, measured on each read. A read one millisecond after the component took its clock gave 299.999 seconds, which shows as "4 min ago". The fixture now adds 30 seconds.

Closes #387

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
claude merged commit eda800fa06 into develop 2026-11-12 15:08:24 -05:00
claude deleted branch feature/384-web-tests-udp-free-port 2026-11-12 15:08:24 -05:00
Sign in to join this conversation.
No reviewers
No project
No assignees
2 participants
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!385
No description provided.