mirror of
https://github.com/golang/go.git
synced 2026-02-04 18:05:03 +03:00
internal/poll: replace t.Sub(time.Now()) with time.Until in test
Change-Id: Ia383d4d322008901cd1e57b05fb522db44076fa2
GitHub-Last-Rev: 5c7cbeb737
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>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user