mirror of
https://github.com/golang/go
synced 2024-11-24 20:20:03 -07:00
http: drain the pipe output in TestHandlerPanic to avoid logging deadlock.
R=r CC=golang-dev https://golang.org/cl/4756047
This commit is contained in:
parent
08e47ebb7d
commit
a8e0035bd3
@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user