The DNSCrypt tests that expect a reply wait up to 30 seconds for it, while the tests that expect silence keep a short window #408

Merged
claude merged 2 commits from feature/406-dnscrypt-reply-wait into develop 2026-11-13 03:07:47 -05:00
Owner

The DNSCrypt tests that expect a reply wait up to 30 seconds for it, and the tests that expect silence wait for the server's decision before they open their short window. Test code only; no defect was found in the DNSCrypt listener.

  • Failure: DnsCryptExpiredCertificateTests.Udp_AQueryForACertificateThatIsStillValid_GetsTheEchoAnswer failed once on a heavily loaded runner with Assert.NotNull() Failure: Value is null (run 1520).
  • Cause: the class's helper gave every case 500 ms to receive a reply, including the case that must get one.
  • Fix in DnsCryptExpiredCertificateTests: the still-valid test waits up to 30 s (the wait ends when the reply arrives); the expired test keeps 500 ms.
  • Same pattern in DnsCryptDiscoveryLimitTests: three tests that need a reply used the 500 ms helper and now use a 30-second one that fails with a message on timeout.
  • Found by the verifier: three silence tests there assert, after the 500 ms window, that the rate limiter was called. On a stalled machine the limiter might not have run yet. The fake limiter now signals its call, and those tests wait for the signal (up to 30 s) before the silence window starts.
  • Left as they are: the 5 s and 10 s positive bounds, the 500 ms silence windows that assert only a missing reply, and a 2 s loopback connect. The reserve-and-release port calls belong to #362.

Verified

  • Build 0 warnings, 0 errors; Ninlil.Dns.Protocol.DnsCrypt.Tests 54 of 54 in 1 s; the two changed classes 20 runs in a row; csharpier clean.
  • The failure could not be shown on demand (no artificial load on the runner), so the fix rests on the code path.
  • Verifier: fix needed on the first round (the limiter race above), accepted on the second. It confirmed by reading that a valid query sent after IsListening cannot be dropped except by slowness. One optional wording nit on the ReplyTimeout summary is not applied.

Closes #406

🤖 Generated with Claude Code

https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK

The DNSCrypt tests that expect a reply wait up to 30 seconds for it, and the tests that expect silence wait for the server's decision before they open their short window. Test code only; no defect was found in the DNSCrypt listener. - **Failure:** `DnsCryptExpiredCertificateTests.Udp_AQueryForACertificateThatIsStillValid_GetsTheEchoAnswer` failed once on a heavily loaded runner with `Assert.NotNull() Failure: Value is null` (run 1520). - **Cause:** the class's helper gave every case 500 ms to receive a reply, including the case that must get one. - **Fix in `DnsCryptExpiredCertificateTests`:** the still-valid test waits up to 30 s (the wait ends when the reply arrives); the expired test keeps 500 ms. - **Same pattern in `DnsCryptDiscoveryLimitTests`:** three tests that need a reply used the 500 ms helper and now use a 30-second one that fails with a message on timeout. - **Found by the verifier:** three silence tests there assert, after the 500 ms window, that the rate limiter was called. On a stalled machine the limiter might not have run yet. The fake limiter now signals its call, and those tests wait for the signal (up to 30 s) before the silence window starts. - **Left as they are:** the 5 s and 10 s positive bounds, the 500 ms silence windows that assert only a missing reply, and a 2 s loopback connect. The reserve-and-release port calls belong to #362. **Verified** - Build 0 warnings, 0 errors; `Ninlil.Dns.Protocol.DnsCrypt.Tests` 54 of 54 in 1 s; the two changed classes 20 runs in a row; csharpier clean. - The failure could not be shown on demand (no artificial load on the runner), so the fix rests on the code path. - Verifier: fix needed on the first round (the limiter race above), accepted on the second. It confirmed by reading that a valid query sent after `IsListening` cannot be dropped except by slowness. One optional wording nit on the `ReplyTimeout` summary is not applied. Closes #406 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
The wait ends as soon as the reply arrives, so the tests stay fast; a loaded machine that answers late no longer fails them.

Closes #406

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
The DNSCrypt silence tests wait for the rate limiter's decision before they open their short window
All checks were successful
Build / Pack and Push NuGet Packages (dhcp) (pull_request) Successful in -2m8s
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Successful in -2m4s
Build / Stage Draft Release (push) Successful in -2m36s
Build / Pack and Push NuGet Packages (common) (push) Successful in -2m19s
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Successful in -1m54s
Build / Pack and Push NuGet Packages (dhcp) (push) Successful in -2m10s
Build / Pack and Push NuGet Packages (dns-core) (push) Successful in -2m9s
Build / Pack and Push NuGet Packages (dns-server) (push) Successful in -1m57s
Build / Build Binary (linux-amd64) (pull_request) Successful in -38s
Build / Build Binary (linux-arm64) (pull_request) Successful in -1m3s
Build / Build Binary (macos-arm64) (pull_request) Successful in -58s
Build / Build Binary (macos-amd64) (pull_request) Successful in -57s
Build / Build Binary (windows-amd64) (pull_request) Successful in -1m14s
Build / Smoke Test the Windows Binary (pull_request) Successful in 15s
Build / Build Binary (linux-amd64) (push) Successful in -1m7s
Build / Build Binary (linux-arm64) (push) Successful in -52s
Build / Build Binary (macos-amd64) (push) Successful in -1m11s
Build / Build Binary (macos-arm64) (push) Successful in -1m15s
Build / Build Binary (windows-amd64) (push) Successful in -1m10s
Build / Smoke Test the Windows Binary (push) Successful in 15s
Build / Build Arch Linux Packages (pull_request) Successful in -2m3s
Build / Build and Push Image (pull_request) Successful in -2m32s
Build / Build Arch Linux Packages (push) Successful in -2m6s
Build / Build and Test Deb and RPM Packages (pull_request) Successful in 22s
Build / Build and Push Image (push) Successful in -2m32s
Build / Build and Test Deb and RPM Packages (push) Successful in 0s
Build / Publish Release (pull_request) Successful in -2m34s
Build / Pipeline (pull_request) Successful in 0s
Build / Publish Release (push) Successful in -2m31s
Build / Pipeline (push) Successful in 0s
0aedb52443
The tests that assert a limiter call after expecting no reply can no longer fail when a stalled machine delays the listener.

Refs #406

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
claude merged commit d2d6c1232b into develop 2026-11-13 03:07:47 -05:00
claude deleted branch feature/406-dnscrypt-reply-wait 2026-11-13 03:07:47 -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!408
No description provided.