mirror of
https://github.com/coredns/coredns.git
synced 2026-09-02 10:07:05 -04:00
test: fix flaky tests that don't check dns.Exchange response is non-nil (#8501)
dns.Exchange may return nil on error. Signed-off-by: Ilya Kulakov <kulakov.ilya@gmail.com>
This commit is contained in:
@@ -40,7 +40,7 @@ func TestClasslessReverse(t *testing.T) {
|
||||
|
||||
r, e := dns.Exchange(m, udp)
|
||||
if e != nil {
|
||||
t.Errorf("Test %d, expected no error, got %q", i, e)
|
||||
t.Fatalf("Test %d, expected no error, got %q", i, e)
|
||||
}
|
||||
if r.Rcode != tc.rcode {
|
||||
t.Errorf("Test %d, expected %d, got %d for %s", i, tc.rcode, r.Rcode, tc.addr)
|
||||
@@ -86,7 +86,7 @@ func TestReverse(t *testing.T) {
|
||||
|
||||
r, e := dns.Exchange(m, udp)
|
||||
if e != nil {
|
||||
t.Errorf("Test %d, expected no error, got %q", i, e)
|
||||
t.Fatalf("Test %d, expected no error, got %q", i, e)
|
||||
}
|
||||
if r.Rcode != tc.rcode {
|
||||
t.Errorf("Test %d, expected %d, got %d for %s", i, tc.rcode, r.Rcode, tc.addr)
|
||||
@@ -132,7 +132,7 @@ func TestReverseInAddr(t *testing.T) {
|
||||
|
||||
r, e := dns.Exchange(m, udp)
|
||||
if e != nil {
|
||||
t.Errorf("Test %d, expected no error, got %q", i, e)
|
||||
t.Fatalf("Test %d, expected no error, got %q", i, e)
|
||||
}
|
||||
if r.Rcode != tc.rcode {
|
||||
t.Errorf("Test %d, expected %d, got %d for %s", i, tc.rcode, r.Rcode, tc.addr)
|
||||
|
||||
Reference in New Issue
Block a user