diff --git a/src/net/http/responsecontroller_test.go b/src/net/http/responsecontroller_test.go index c560e4bc544d7b..5828f3795a5289 100644 --- a/src/net/http/responsecontroller_test.go +++ b/src/net/http/responsecontroller_test.go @@ -199,8 +199,12 @@ func testResponseControllerSetPastReadDeadline(t *testing.T, mode testMode) { select { case <-readc: case <-donec: - t.Errorf("server handler unexpectedly exited without closing readc") - return + select { + case <-readc: + default: + t.Errorf("server handler unexpectedly exited without closing readc") + return + } } pw.Write([]byte("two")) }()