resolver tests: retry an answer missing the record type read (closes #218)
check / check (push) Canceled after 0s

QueryNameserver sends one query per record type. When only the AAAA or
MX query was lost, the answer still had status ok, liveQueryNameserver
did not retry it, and the test found no AAAA or MX records.
liveQueryNameserver now takes the record types a test reads and, through
livednstest, retries an answer that holds records of none of them. The
A, AAAA, MX and TXT tests name theirs. A resolver that loses a type for
good still fails, after the last attempt instead of the first.

Model: opus-5-5
This commit was merged in pull request #232.
This commit is contained in:
2026-10-02 07:52:44 +02:00
parent 3182fc99a6
commit a18803ff28
3 changed files with 24 additions and 4 deletions
+4 -4
View File
@@ -171,7 +171,7 @@ func TestQueryNameserver_BasicA(t *testing.T) {
r := newTestResolver(t)
ns := findOneNSForDomain(t, r, "google.com")
resp := liveQueryNameserver(t, r, ns, "www.google.com")
resp := liveQueryNameserver(t, r, ns, "www.google.com", "A", "CNAME")
require.NotNil(t, resp)
@@ -190,7 +190,7 @@ func TestQueryNameserver_AAAA(t *testing.T) {
r := newTestResolver(t)
ns := findOneNSForDomain(t, r, "cloudflare.com")
resp := liveQueryNameserver(t, r, ns, "cloudflare.com")
resp := liveQueryNameserver(t, r, ns, "cloudflare.com", "AAAA")
aaaaRecords := resp.Records["AAAA"]
require.NotEmpty(t, aaaaRecords,
@@ -210,7 +210,7 @@ func TestQueryNameserver_MX(t *testing.T) {
r := newTestResolver(t)
ns := findOneNSForDomain(t, r, "google.com")
resp := liveQueryNameserver(t, r, ns, "google.com")
resp := liveQueryNameserver(t, r, ns, "google.com", "MX")
mxRecords := resp.Records["MX"]
require.NotEmpty(t, mxRecords,
@@ -223,7 +223,7 @@ func TestQueryNameserver_TXT(t *testing.T) {
r := newTestResolver(t)
ns := findOneNSForDomain(t, r, "google.com")
resp := liveQueryNameserver(t, r, ns, "google.com")
resp := liveQueryNameserver(t, r, ns, "google.com", "TXT")
txtRecords := resp.Records["TXT"]
require.NotEmpty(t, txtRecords,