git » chasquid » commit 0fd3941

courier: Don't call testing.T.Fatalf from a goroutine

author Alberto Bertogli
2020-04-13 12:59:36 UTC
committer Alberto Bertogli
2020-04-14 11:01:01 UTC
parent 15b79d9de98ae6828a3615b397d75e5dadcf46f1

courier: Don't call testing.T.Fatalf from a goroutine

Calling testing.T.Fatalf from a new goroutine is not supported; since
this should be quite exceptional, we just panic instead.

internal/courier/smtp_test.go +1 -1

diff --git a/internal/courier/smtp_test.go b/internal/courier/smtp_test.go
index 6cd83df..8af462b 100644
--- a/internal/courier/smtp_test.go
+++ b/internal/courier/smtp_test.go
@@ -55,7 +55,7 @@ func fakeServer(t *testing.T, responses map[string]string) (string, *sync.WaitGr
 
 		c, err := l.Accept()
 		if err != nil {
-			t.Fatalf("fake server accept: %v", err)
+			panic(err)
 		}
 		defer c.Close()