aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/chan_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/runtime/chan_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/runtime/chan_test.go')
-rw-r--r--src/runtime/chan_test.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/runtime/chan_test.go b/src/runtime/chan_test.go
index 8e8c47b48d..a75fa1b992 100644
--- a/src/runtime/chan_test.go
+++ b/src/runtime/chan_test.go
@@ -210,11 +210,14 @@ func TestNonblockRecvRace(t *testing.T) {
select {
case <-c:
default:
- t.Fatal("chan is not ready")
+ t.Error("chan is not ready")
}
}()
close(c)
<-c
+ if t.Failed() {
+ return
+ }
}
}
@@ -311,14 +314,16 @@ func TestSelfSelect(t *testing.T) {
case c <- p:
case v := <-c:
if chanCap == 0 && v == p {
- t.Fatalf("self receive")
+ t.Errorf("self receive")
+ return
}
}
} else {
select {
case v := <-c:
if chanCap == 0 && v == p {
- t.Fatalf("self receive")
+ t.Errorf("self receive")
+ return
}
case c <- p:
}