mirror of
https://github.com/golang/go.git
synced 2025-11-02 01:30:55 +00:00
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>
This commit is contained in:
parent
9be14c4058
commit
a145890059
14 changed files with 68 additions and 40 deletions
|
|
@ -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)
|
||||
}()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue