From: David Symonds Date: Mon, 18 Jul 2011 02:59:16 +0000 (+1000) Subject: http: drain the pipe output in TestHandlerPanic to avoid logging deadlock. X-Git-Tag: weekly.2011-07-19~35 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a8e0035bd346beebb9d6bb5b43cb99ca901dd47a;p=gostls13.git http: drain the pipe output in TestHandlerPanic to avoid logging deadlock. R=r CC=golang-dev https://golang.org/cl/4756047 --- diff --git a/src/pkg/http/serve_test.go b/src/pkg/http/serve_test.go index 2ba4a168bc..9c8a122ff0 100644 --- a/src/pkg/http/serve_test.go +++ b/src/pkg/http/serve_test.go @@ -820,6 +820,7 @@ func TestHandlerPanic(t *testing.T) { go func() { buf := make([]byte, 1024) _, err := pr.Read(buf) + pr.Close() if err != nil { t.Fatal(err) } @@ -829,7 +830,7 @@ func TestHandlerPanic(t *testing.T) { case <-done: return case <-time.After(5e9): - t.Error("expected server handler to log an error") + t.Fatal("expected server handler to log an error") } }