The TCP zone transfer duration test fails when the listener reads the query later than its 300 ms idle timeout #389

Closed
opened 2026-11-12 15:30:48 -05:00 by claude · 0 comments
Owner

TcpZoneTransferDurationTests.AnAxfrThatOutlivesTheIdleTimeout_Completes failed once in the Linux test job of pull-request run 1497 (PR #388, develop into main, attempt 1): 1 of 21 in Ninlil.Dns.Protocol.Plain.Tests. The same commit (eda800fa) passed in the develop push run 1495 on Linux and on Windows.

Failure

  • TcpZoneTransferDurationTests.cs:36: NullReferenceException. ReadMessageOrEndAsync returned null for the first message, so the connection ended before message 1 arrived. The test took 1 s.

Likely cause (not reproduced)

  • The test shortens PlainProtocolOptions.TcpIdleTimeout to 300 ms. The class comment says the test has no clock to race, which holds for the pause in the middle of the transfer, but not for the start: the listener's read-idle timeout runs from the accept until the query frame is read. The job runs many test projects in parallel on asgard; when the listener's read of the query is delayed by more than 300 ms, it closes the connection as idle before the transfer begins.
  • Check that reading first: if the listener can close a connection whose query bytes have already arrived, that is a product defect, not a test one.

Fix (proposal)

  • Start with a generous idle timeout for the query and prove the "outlives the idle timeout" part another way (for example a longer timeout with a proportionally longer pause, or a fake time provider if the listener takes one), so that a slow first read cannot end the connection.

Done when

  • The test does not depend on the listener reading the query within 300 ms.
`TcpZoneTransferDurationTests.AnAxfrThatOutlivesTheIdleTimeout_Completes` failed once in the Linux test job of pull-request run 1497 (PR #388, `develop` into `main`, attempt 1): 1 of 21 in `Ninlil.Dns.Protocol.Plain.Tests`. The same commit (`eda800fa`) passed in the `develop` push run 1495 on Linux and on Windows. **Failure** - `TcpZoneTransferDurationTests.cs:36`: `NullReferenceException`. `ReadMessageOrEndAsync` returned `null` for the first message, so the connection ended before message 1 arrived. The test took 1 s. **Likely cause (not reproduced)** - The test shortens `PlainProtocolOptions.TcpIdleTimeout` to 300 ms. The class comment says the test has no clock to race, which holds for the pause in the middle of the transfer, but not for the start: the listener's read-idle timeout runs from the accept until the query frame is read. The job runs many test projects in parallel on asgard; when the listener's read of the query is delayed by more than 300 ms, it closes the connection as idle before the transfer begins. - Check that reading first: if the listener can close a connection whose query bytes have already arrived, that is a product defect, not a test one. **Fix (proposal)** - Start with a generous idle timeout for the query and prove the "outlives the idle timeout" part another way (for example a longer timeout with a proportionally longer pause, or a fake time provider if the listener takes one), so that a slow first read cannot end the connection. **Done when** - The test does not depend on the listener reading the query within 300 ms.
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#389
No description provided.