Fix panic in upstream test if upstream returns with i/o timeout
This commit is contained in:
parent
504aaddc32
commit
58129543de
|
@ -167,11 +167,11 @@ func testUpstream(t *testing.T, u Upstream) {
|
||||||
resp, err := u.Exchange(context.Background(), &req)
|
resp, err := u.Exchange(context.Background(), &req)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("error while making an upstream request: %s", err)
|
t.Fatalf("error while making an upstream request: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(resp.Answer) != 1 {
|
if len(resp.Answer) != 1 {
|
||||||
t.Errorf("no answer section in the response")
|
t.Fatalf("no answer section in the response")
|
||||||
}
|
}
|
||||||
if answer, ok := resp.Answer[0].(*dns.A); ok {
|
if answer, ok := resp.Answer[0].(*dns.A); ok {
|
||||||
if !test.expected.Equal(answer.A) {
|
if !test.expected.Equal(answer.A) {
|
||||||
|
|
Loading…
Reference in New Issue