]> Cypherpunks repositories - gostls13.git/commitdiff
http: drain the pipe output in TestHandlerPanic to avoid logging deadlock.
authorDavid Symonds <dsymonds@golang.org>
Mon, 18 Jul 2011 02:59:16 +0000 (12:59 +1000)
committerDavid Symonds <dsymonds@golang.org>
Mon, 18 Jul 2011 02:59:16 +0000 (12:59 +1000)
R=r
CC=golang-dev
https://golang.org/cl/4756047

src/pkg/http/serve_test.go

index 2ba4a168bc5d8ba6c0a563b15d13dff1a98d97e4..9c8a122ff0413a88b8adaa7051d916ad74050746 100644 (file)
@@ -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")
        }
 }