From 16f7687f5001b816ff9f6b586071238941e88a9d Mon Sep 17 00:00:00 2001 From: Artyom Pervukhin Date: Tue, 5 Jan 2021 16:42:53 +0300 Subject: [PATCH] unix: don't call testing.T.Fatalf in a background goroutine > Those methods [...] must be called only from the goroutine running the > Test function. For golang/go#43498 Change-Id: I847067936ade613a21b059c90219bd285425f0aa Reviewed-on: https://go-review.googlesource.com/c/sys/+/280622 Reviewed-by: Keith Randall Run-TryBot: Keith Randall TryBot-Result: Go Bot Trust: Ian Lance Taylor --- unix/syscall_unix_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/unix/syscall_unix_test.go b/unix/syscall_unix_test.go index 41de3b84..e9cc5b1c 100644 --- a/unix/syscall_unix_test.go +++ b/unix/syscall_unix_test.go @@ -906,14 +906,17 @@ func TestPipe(t *testing.T) { go func() { n, err := unix.Write(w, []byte(s)) if err != nil { - t.Fatalf("bad write: %s\n", err) + t.Errorf("bad write: %s\n", err) + return } if n != len(s) { - t.Fatalf("bad write count: %d\n", n) + t.Errorf("bad write count: %d\n", n) + return } err = unix.Close(w) if err != nil { - t.Fatalf("bad close: %s\n", err) + t.Errorf("bad close: %s\n", err) + return } }() var buf [10 + len(s)]byte