From 5c7cbeb7371c6afa47c280e164087e45ca89f3d2 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Mon, 18 Mar 2024 15:29:36 +0800 Subject: [PATCH] internal/poll: replace t.Sub(time.Now()) with time.Until in test Signed-off-by: guoguangwu --- src/internal/poll/splice_linux_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)