aboutsummaryrefslogtreecommitdiff
path: root/src/net/dnsclient_unix_test.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2016-11-14 21:34:58 -0800
committerIan Lance Taylor <iant@golang.org>2016-11-15 15:13:48 +0000
commita145890059e9c7aae870e1b9e74b204b6c8bc8d5 (patch)
tree1547295a4c8da59ce960dcc84e3c0309edf9db02 /src/net/dnsclient_unix_test.go
parent9be14c4058287f88dc927ea847e3d6d57ff4047b (diff)
downloadgo-a145890059e9c7aae870e1b9e74b204b6c8bc8d5.tar.gz
go-a145890059e9c7aae870e1b9e74b204b6c8bc8d5.zip
all: don't call t.Fatal from a goroutine
Fixes #17900. Change-Id: I42cda6ac9cf48ed739d3a015a90b3cb15edf8ddf Reviewed-on: https://go-review.googlesource.com/33243 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/net/dnsclient_unix_test.go')
-rw-r--r--src/net/dnsclient_unix_test.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/net/dnsclient_unix_test.go b/src/net/dnsclient_unix_test.go
index 8ee64d407c..7dc364de50 100644
--- a/src/net/dnsclient_unix_test.go
+++ b/src/net/dnsclient_unix_test.go
@@ -668,12 +668,14 @@ func TestIgnoreDNSForgeries(t *testing.T) {
b := make([]byte, 512)
n, err := s.Read(b)
if err != nil {
- t.Fatal(err)
+ t.Error(err)
+ return
}
msg := &dnsMsg{}
if !msg.Unpack(b[:n]) {
- t.Fatal("invalid DNS query")
+ t.Error("invalid DNS query")
+ return
}
s.Write([]byte("garbage DNS response packet"))
@@ -682,7 +684,8 @@ func TestIgnoreDNSForgeries(t *testing.T) {
msg.id++ // make invalid ID
b, ok := msg.Pack()
if !ok {
- t.Fatal("failed to pack DNS response")
+ t.Error("failed to pack DNS response")
+ return
}
s.Write(b)
@@ -701,7 +704,8 @@ func TestIgnoreDNSForgeries(t *testing.T) {
b, ok = msg.Pack()
if !ok {
- t.Fatal("failed to pack DNS response")
+ t.Error("failed to pack DNS response")
+ return
}
s.Write(b)
}()