mirror of
https://github.com/tailscale/tailscale.git
synced 2025-11-14 01:25:20 +00:00
net/nettest: deflake TestPipeTimeout
The block-write and block-read tests are both flaky, because each assumes it can get a normal read/write completed within 10ms. This isn’t always true. We can’t increase the timeouts, because that slows down the test. However, we don’t need to issue a regular read/write for this test. The immediately preceding tests already test this code, using a far more generous timeout. Remove the extraneous read/write. This drops the failure rate from 1 per 20,000 to undetectable on my machine. While we’re here, fix a typo in a debug print statement. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
committed by
Josh Bleecher Snyder
parent
a8cc519c70
commit
e16cb523aa
@@ -76,7 +76,7 @@ func (p *Pipe) Read(b []byte) (n int, err error) {
|
||||
if debugPipe {
|
||||
orig := b
|
||||
defer func() {
|
||||
log.Printf("Pipe(%q).Read( %q) n=%d, err=%v", p.name, string(orig[:n]), n, err)
|
||||
log.Printf("Pipe(%q).Read(%q) n=%d, err=%v", p.name, string(orig[:n]), n, err)
|
||||
}()
|
||||
}
|
||||
for n == 0 {
|
||||
|
||||
Reference in New Issue
Block a user