• Richard Miller's avatar
    net/http: adaptive wait time in PersistConnLeak tests · 34f0c0b3
    Richard Miller authored
    In tests TransportPersistConnLeak and TransportPersistConnLeakShortBody,
    there's a fixed wait time (100ms and 400ms respectively) to allow
    goroutines to exit after CloseIdleConnections is called. This
    is sometimes too short on a slow host running many simultaneous
    tests.
    
    This CL replaces the fixed sleep in each test with a sequence of
    shorter sleeps, testing the number of remaining goroutines until
    it reaches the threshold or an overall time limit of 500ms expires.
    This prevents some failures in the plan9_arm builder, while reducing
    the test time on faster machines.
    
    Fixes #14887
    
    Change-Id: Ia5c871062df139e2667cdfb2ce8283e135435318
    Reviewed-on: https://go-review.googlesource.com/20922
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    34f0c0b3
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...