diff --git a/src/internal/poll/splice_linux_test.go b/src/internal/poll/splice_linux_test.go index 29bcaab4140..99d8b161814 100644 --- a/src/internal/poll/splice_linux_test.go +++ b/src/internal/poll/splice_linux_test.go @@ -59,7 +59,7 @@ func TestSplicePipePool(t *testing.T) { // Exploit the timeout of "go test" as a timer for the subsequent verification. timeout := 5 * time.Minute if deadline, ok := t.Deadline(); ok { - timeout = deadline.Sub(time.Now()) + timeout = time.Until(deadline) timeout -= timeout / 10 // Leave 10% headroom for cleanup. } expiredTime := time.NewTimer(timeout)