• Daniel Morsing's avatar
    net/http: silence race detector on client header timeout test · 516f0d1c
    Daniel Morsing authored
    When running the client header timeout test, there is a race between
    us timing out and waiting on the remaining requests to be serviced. If
    the client times out before the server blocks on the channel in the
    handler, we will be simultaneously adding to a waitgroup with the
    value 0 and waiting on it when we call TestServer.Close().
    
    This is largely a theoretical race. We have to time out before we
    enter the handler and the only reason we would time out if we're
    blocked on the channel. Nevertheless, make the race detector happy
    by turning the close into a channel send. This turns the defer call
    into a synchronization point and we can be sure that we've entered
    the handler before we close the server.
    
    Fixes #10780
    
    Change-Id: Id73b017d1eb7503e446aa51538712ef49f2f5c9e
    Reviewed-on: https://go-review.googlesource.com/9905Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    516f0d1c
Name
Last commit
Last update
..
cgi Loading commit data...
cookiejar Loading commit data...
fcgi Loading commit data...
httptest Loading commit data...
httputil Loading commit data...
internal Loading commit data...
pprof Loading commit data...
testdata Loading commit data...
client.go Loading commit data...
client_test.go Loading commit data...
cookie.go Loading commit data...
cookie_test.go Loading commit data...
doc.go Loading commit data...
example_test.go Loading commit data...
export_test.go Loading commit data...
filetransport.go Loading commit data...
filetransport_test.go Loading commit data...
fs.go Loading commit data...
fs_test.go Loading commit data...
header.go Loading commit data...
header_test.go Loading commit data...
http_test.go Loading commit data...
jar.go Loading commit data...
lex.go Loading commit data...
lex_test.go Loading commit data...
main_test.go Loading commit data...
npn_test.go Loading commit data...
proxy_test.go Loading commit data...
race.go Loading commit data...
range_test.go Loading commit data...
readrequest_test.go Loading commit data...
request.go Loading commit data...
request_test.go Loading commit data...
requestwrite_test.go Loading commit data...
response.go Loading commit data...
response_test.go Loading commit data...
responsewrite_test.go Loading commit data...
serve_test.go Loading commit data...
server.go Loading commit data...
sniff.go Loading commit data...
sniff_test.go Loading commit data...
status.go Loading commit data...
transfer.go Loading commit data...
transfer_test.go Loading commit data...
transport.go Loading commit data...
transport_test.go Loading commit data...
triv.go Loading commit data...