The TCP listener tests no longer fail when a loaded machine delivers the query after the idle timeout #398

Merged
claude merged 2 commits from feature/389-zone-transfer-duration-test into develop 2026-11-12 20:36:44 -05:00
Owner

The TCP listener tests no longer fail when a loaded machine delivers the query after the test's shortened idle timeout. Test code only.

  • Failure: TcpZoneTransferDurationTests.AnAxfrThatOutlivesTheIdleTimeout_Completes failed once in CI: the connection ended before the first transfer message. Reproduced: 3 of 30 runs under heavy CPU load.
  • Cause: not a listener defect. The idle timer in FramedDnsStreamSession runs from accept and is disarmed once the query frame is read; the transfer then runs on its own limit. The test's 300 ms timeout expired before its own client had sent the query. With the default TcpIdleTimeout of 30 s this needs a 30-second stall and is not something an operator meets.
  • Fix: the duration test and TcpStreamSessionTests' fresh-connection checks retry on a new connection when the connection ends before the first reply, at most TcpStreamTestHost.MaxFreshConnectionAttempts (4) times. Every later step stays a hard assertion. The constant's summary says what the retry tolerates and what it would hide.

Verified

  • Same load loop after the first commit: 0 of 30 failed. Ninlil.Dns.Protocol.Plain.Tests 21 of 21; build 0 warnings; csharpier clean.
  • Verifier: confirmed the reading of the listener code and accepted; its findings (retry bound of 10 unjustified and loose) are fixed in the second commit (bound 4: about 10 percent loss per attempt under that load, so four losses in a row are about 1 in 10,000). The load loop was not repeated after the second commit.
  • The same pattern in the DNS-over-TLS tests is #396, not part of this change.

Closes #389

🤖 Generated with Claude Code

https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK

The TCP listener tests no longer fail when a loaded machine delivers the query after the test's shortened idle timeout. Test code only. - **Failure:** `TcpZoneTransferDurationTests.AnAxfrThatOutlivesTheIdleTimeout_Completes` failed once in CI: the connection ended before the first transfer message. Reproduced: 3 of 30 runs under heavy CPU load. - **Cause:** not a listener defect. The idle timer in `FramedDnsStreamSession` runs from accept and is disarmed once the query frame is read; the transfer then runs on its own limit. The test's 300 ms timeout expired before its own client had sent the query. With the default `TcpIdleTimeout` of 30 s this needs a 30-second stall and is not something an operator meets. - **Fix:** the duration test and `TcpStreamSessionTests`' fresh-connection checks retry on a new connection when the connection ends before the first reply, at most `TcpStreamTestHost.MaxFreshConnectionAttempts` (4) times. Every later step stays a hard assertion. The constant's summary says what the retry tolerates and what it would hide. **Verified** - Same load loop after the first commit: 0 of 30 failed. `Ninlil.Dns.Protocol.Plain.Tests` 21 of 21; build 0 warnings; csharpier clean. - Verifier: confirmed the reading of the listener code and accepted; its findings (retry bound of 10 unjustified and loose) are fixed in the second commit (bound 4: about 10 percent loss per attempt under that load, so four losses in a row are about 1 in 10,000). The load loop was not repeated after the second commit. - The same pattern in the DNS-over-TLS tests is #396, not part of this change. Closes #389 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Refs #389

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
The TCP listener tests retry a lost idle-timeout race at most four times, so a listener that drops most first connections still fails them
All checks were successful
Build / Pack and Push NuGet Packages (dhcp) (pull_request) Successful in -2m13s
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Successful in -2m10s
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Successful in -2m0s
Build / Build Binary (linux-amd64) (pull_request) Successful in -1m4s
Build / Build Binary (linux-arm64) (pull_request) Successful in -1m5s
Build / Build Binary (macos-amd64) (pull_request) Successful in -1m1s
Build / Build Binary (macos-arm64) (pull_request) Successful in -1m0s
Build / Stage Draft Release (push) Successful in -2m35s
Build / Pack and Push NuGet Packages (common) (push) Successful in -2m20s
Build / Build Binary (windows-amd64) (pull_request) Successful in -1m8s
Build / Pack and Push NuGet Packages (dhcp) (push) Successful in -2m15s
Build / Smoke Test the Windows Binary (pull_request) Successful in 15s
Build / Pack and Push NuGet Packages (dns-core) (push) Successful in -2m11s
Build / Pack and Push NuGet Packages (dns-server) (push) Successful in -2m3s
Build / Build Binary (linux-amd64) (push) Successful in -57s
Build / Build Binary (linux-arm64) (push) Successful in -1m0s
Build / Build Binary (macos-amd64) (push) Successful in -1m4s
Build / Build Binary (macos-arm64) (push) Successful in -47s
Build / Build Arch Linux Packages (pull_request) Successful in -2m17s
Build / Build Binary (windows-amd64) (push) Successful in -55s
Build / Build and Push Image (pull_request) Successful in -2m22s
Build / Smoke Test the Windows Binary (push) Successful in 15s
Build / Build Arch Linux Packages (push) Successful in -1m37s
Build / Build and Test Deb and RPM Packages (pull_request) Successful in 8s
Build / Build and Push Image (push) Successful in -2m31s
Build / Build and Test Deb and RPM Packages (push) Successful in -14s
Build / Publish Release (pull_request) Successful in -2m34s
Build / Pipeline (pull_request) Successful in 0s
Build / Publish Release (push) Successful in -2m34s
Build / Pipeline (push) Successful in 0s
6a452a141d
Closes #389

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
claude merged commit 8398cdc0d0 into develop 2026-11-12 20:36:44 -05:00
claude deleted branch feature/389-zone-transfer-duration-test 2026-11-12 20:36:45 -05:00
Sign in to join this conversation.
No reviewers
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!398
No description provided.