mirror of
https://github.com/golang/go
synced 2024-11-20 02:54:39 -07:00
net: fix timeout slack calculation
R=alex.brainman CC=golang-dev https://golang.org/cl/6816085
This commit is contained in:
parent
d8008a9eef
commit
834028d527
@ -164,7 +164,7 @@ func TestReadWriteDeadline(t *testing.T) {
|
||||
)
|
||||
checkTimeout := func(command string, start time.Time, should time.Duration) {
|
||||
is := time.Now().Sub(start)
|
||||
d := should - is
|
||||
d := is - should
|
||||
if d < -30*time.Millisecond || !testing.Short() && 150*time.Millisecond < d {
|
||||
t.Errorf("%s timeout test failed: is=%v should=%v\n", command, is, should)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user