Resolver tests for AAAA and MX records fail when one query is lost #218

Closed
opened 2026-10-02 07:17:52 +02:00 by clawbot · 1 comment
Collaborator

TestQueryNameserver_AAAA and TestQueryNameserver_MX in internal/resolver/resolver_test.go fail on next when packets are dropped: with 5% of a test container's outgoing packets dropped, one or the other failed in 2 of 8 runs of the suite (found while reworking #209). The CI runner has dropped queries like this before (#214), so this can turn next red.

Likely cause: liveQueryNameserver (internal/resolver/livedns_test.go) retries only when the whole answer is a timeout. QueryNameserver sends one query per record type, so when only the AAAA or MX query is lost the answer still counts as fine, the attempt is not retried, and the test finds no AAAA or MX records.

Definition of done:

  • These tests, and any other resolver test that asserts on one record type from QueryNameserver, retry the attempt through internal/livednstest when that record type is missing, as they already do for a timeout.
  • DNS is never mocked: no stand-in resolver, no skipped test, nothing taken out of the default run, no longer time limits.
  • Under 5% packet loss (tc qdisc ... netem loss 5% in a container), 8 runs of the suite on the branch have no resolver failures, and the suite takes about as long as on next.

Model: opus-5-5

`TestQueryNameserver_AAAA` and `TestQueryNameserver_MX` in `internal/resolver/resolver_test.go` fail on `next` when packets are dropped: with 5% of a test container's outgoing packets dropped, one or the other failed in 2 of 8 runs of the suite (found while reworking https://git.eeqj.de/sneak/dnswatcher/pulls/209). The CI runner has dropped queries like this before (https://git.eeqj.de/sneak/dnswatcher/issues/214), so this can turn `next` red. Likely cause: `liveQueryNameserver` (`internal/resolver/livedns_test.go`) retries only when the whole answer is a timeout. `QueryNameserver` sends one query per record type, so when only the AAAA or MX query is lost the answer still counts as fine, the attempt is not retried, and the test finds no AAAA or MX records. Definition of done: - These tests, and any other resolver test that asserts on one record type from `QueryNameserver`, retry the attempt through `internal/livednstest` when that record type is missing, as they already do for a timeout. - DNS is never mocked: no stand-in resolver, no skipped test, nothing taken out of the default run, no longer time limits. - Under 5% packet loss (`tc qdisc ... netem loss 5%` in a container), 8 runs of the suite on the branch have no resolver failures, and the suite takes about as long as on `next`. Model: opus-5-5
clawbot added this to the 1.0 milestone 2026-10-02 07:17:52 +02:00
clawbot self-assigned this 2026-10-02 07:17:52 +02:00
Author
Collaborator

#232 makes liveQueryNameserver retry an answer that holds none of the record types the test reads. The A, AAAA, MX and TXT tests name theirs. It does not cover a truncated TXT reply whose TCP retry fails; that resolver defect is #231.

Model: opus-5-5

https://git.eeqj.de/sneak/dnswatcher/pulls/232 makes `liveQueryNameserver` retry an answer that holds none of the record types the test reads. The A, AAAA, MX and TXT tests name theirs. It does not cover a truncated TXT reply whose TCP retry fails; that resolver defect is https://git.eeqj.de/sneak/dnswatcher/issues/231. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/dnswatcher#218