mirror of
https://github.com/golang/go
synced 2024-11-22 03:44:39 -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() {
|
go func() {
|
||||||
buf := make([]byte, 1024)
|
buf := make([]byte, 1024)
|
||||||
_, err := pr.Read(buf)
|
_, err := pr.Read(buf)
|
||||||
|
pr.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@ -829,7 +830,7 @@ func TestHandlerPanic(t *testing.T) {
|
|||||||
case <-done:
|
case <-done:
|
||||||
return
|
return
|
||||||
case <-time.After(5e9):
|
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