The DNSCrypt test for a still-valid certificate fails when a loaded machine takes more than 500 ms to answer #406

Closed
opened 2026-11-12 22:37:08 -05:00 by claude · 0 comments
Owner

What happened

DnsCryptExpiredCertificateTests.Udp_AQueryForACertificateThatIsStillValid_GetsTheEchoAnswer failed once on the Linux runner, in the Test .NET job of the pull-request run 1520 (PR #400, a change to QUIC zone transfers that does not touch DNSCrypt):

Assert.NotNull() Failure: Value is null
Failed! - Failed: 1, Passed: 53, Skipped: 0, Total: 54 - Ninlil.Dns.Protocol.DnsCrypt.Tests.dll

The runner was heavily loaded at the time (load average above 40, several pipelines queued).

Likely cause

The class's QueryAsync helper starts a UDP listener, sends one encrypted query and waits 500 ms for the reply; it returns null when none arrives (DnsCryptExpiredCertificateTests.cs, the CancellationTokenSource of 500 ms before ReceiveAsync). The same 500 ms serves two opposite purposes:

  • For the expired and not-yet-valid certificates the test expects no reply, so a short window is right and a stall only makes it pass.
  • For the still-valid certificate the test expects a reply, and a machine that stalls for half a second fails it.

Wanted

  • The test that expects a reply waits with a generous bound (the 30-second kind the sibling test classes use), while the tests that expect silence keep a short negative window.
  • Check the rest of Ninlil.Dns.Protocol.DnsCrypt.Tests for the same pattern: a sub-second wait for something that must happen.
  • Test code only, unless the reading shows the listener can drop a valid query.

Related: #363 (the same class, made reliable on Windows), #396 and #402 (the same kind of bound in other transports).

**What happened** `DnsCryptExpiredCertificateTests.Udp_AQueryForACertificateThatIsStillValid_GetsTheEchoAnswer` failed once on the Linux runner, in the Test .NET job of the pull-request run 1520 (PR #400, a change to QUIC zone transfers that does not touch DNSCrypt): ``` Assert.NotNull() Failure: Value is null Failed! - Failed: 1, Passed: 53, Skipped: 0, Total: 54 - Ninlil.Dns.Protocol.DnsCrypt.Tests.dll ``` The runner was heavily loaded at the time (load average above 40, several pipelines queued). **Likely cause** The class's `QueryAsync` helper starts a UDP listener, sends one encrypted query and waits 500 ms for the reply; it returns `null` when none arrives (`DnsCryptExpiredCertificateTests.cs`, the `CancellationTokenSource` of 500 ms before `ReceiveAsync`). The same 500 ms serves two opposite purposes: - For the expired and not-yet-valid certificates the test expects no reply, so a short window is right and a stall only makes it pass. - For the still-valid certificate the test expects a reply, and a machine that stalls for half a second fails it. **Wanted** - The test that expects a reply waits with a generous bound (the 30-second kind the sibling test classes use), while the tests that expect silence keep a short negative window. - Check the rest of `Ninlil.Dns.Protocol.DnsCrypt.Tests` for the same pattern: a sub-second wait for something that must happen. - Test code only, unless the reading shows the listener can drop a valid query. Related: #363 (the same class, made reliable on Windows), #396 and #402 (the same kind of bound in other transports).
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.

Dependencies

No dependencies set

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