mirror of
https://github.com/golang/go
synced 2024-11-21 23:24:41 -07:00
internal/poll: replace t.Sub(time.Now()) with time.Until in test
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
This commit is contained in:
parent
0a6f05e30f
commit
5c7cbeb737
@ -59,7 +59,7 @@ func TestSplicePipePool(t *testing.T) {
|
|||||||
// Exploit the timeout of "go test" as a timer for the subsequent verification.
|
// Exploit the timeout of "go test" as a timer for the subsequent verification.
|
||||||
timeout := 5 * time.Minute
|
timeout := 5 * time.Minute
|
||||||
if deadline, ok := t.Deadline(); ok {
|
if deadline, ok := t.Deadline(); ok {
|
||||||
timeout = deadline.Sub(time.Now())
|
timeout = time.Until(deadline)
|
||||||
timeout -= timeout / 10 // Leave 10% headroom for cleanup.
|
timeout -= timeout / 10 // Leave 10% headroom for cleanup.
|
||||||
}
|
}
|
||||||
expiredTime := time.NewTimer(timeout)
|
expiredTime := time.NewTimer(timeout)
|
||||||
|
Loading…
Reference in New Issue
Block a user