aboutsummaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authorguoguangwu <guoguangwug@gmail.com>2024-03-18 07:34:04 +0000
committerGopher Robot <gobot@golang.org>2025-11-25 08:02:14 -0800
commit09e377b599cd723286af65ee2f741fd99b5d7676 (patch)
tree96f356ee0f7a16405de50e5331404583f10da69c /src/internal
parent4fb7e083a868946db08db9ef3bc807e21c8fc961 (diff)
downloadgo-09e377b599cd723286af65ee2f741fd99b5d7676.tar.xz
internal/poll: replace t.Sub(time.Now()) with time.Until in test
Change-Id: Ia383d4d322008901cd1e57b05fb522db44076fa2 GitHub-Last-Rev: 5c7cbeb7371c6afa47c280e164087e45ca89f3d2 GitHub-Pull-Request: golang/go#66375 Reviewed-on: https://go-review.googlesource.com/c/go/+/572178 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Sean Liao <sean@liao.dev> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> Reviewed-by: Sean Liao <sean@liao.dev>
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/poll/splice_linux_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/internal/poll/splice_linux_test.go b/src/internal/poll/splice_linux_test.go
index e4a7eb2b43..9f2b8f9461 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)