• Emmanuel T Odeke's avatar
    net/http: unflake TestTimeoutHandlerSuperfluousLogs · bff4ebb7
    Emmanuel T Odeke authored
    Uses 2 channels to synchronize that test, because
    relying on sleeps creates flaky behavior, thus:
    
    a) 1 buffered channel to send back the last spurious line
    without having to reason about "happens before" behavior
    a) 1 buffered channel at the end of the handler; it'll
    be controlled by whether we expect to timeout or not,
    but will always be closed when the test ends
    
    Fixes #35051
    
    Change-Id: Iff735aa8d1ed9de8d92b792374ec161cc0a72798
    Reviewed-on: https://go-review.googlesource.com/c/go/+/208477
    Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
    bff4ebb7
serve_test.go 170 KB