From bc4da5f5d6a39a80dec91293ced65fb1376f8196 Mon Sep 17 00:00:00 2001 From: John Murret Date: Wed, 17 Jan 2024 07:25:35 -0700 Subject: [PATCH] check error in TestDNSCycleRecursorCheckAllFail before asserting response to stop panic in CI. (#20231) --- agent/dns_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/dns_test.go b/agent/dns_test.go index adc43acb8e..083e4b9536 100644 --- a/agent/dns_test.go +++ b/agent/dns_test.go @@ -320,7 +320,8 @@ func TestDNSCycleRecursorCheckAllFail(t *testing.T) { m.SetQuestion("google.com.", dns.TypeA) // Agent request client := new(dns.Client) - in, _, _ := client.Exchange(m, agent.DNSAddr()) + in, _, err := client.Exchange(m, agent.DNSAddr()) + require.NoError(t, err) // Verify if we hit SERVFAIL from Consul require.Equal(t, dns.RcodeServerFailure, in.Rcode) })