aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/timeout_test.go5
-rw-r--r--src/os/timeout_test.go5
2 files changed, 2 insertions, 8 deletions
diff --git a/src/net/timeout_test.go b/src/net/timeout_test.go
index 09adb9bdca..0d009f6999 100644
--- a/src/net/timeout_test.go
+++ b/src/net/timeout_test.go
@@ -730,10 +730,7 @@ func nextTimeout(actual time.Duration) (next time.Duration, ok bool) {
// duration by any significant margin. Try the next attempt with an arbitrary
// factor above that, so that our growth curve is at least exponential.
next = actual * 5 / 4
- if next > maxDynamicTimeout {
- return maxDynamicTimeout, true
- }
- return next, true
+ return min(next, maxDynamicTimeout), true
}
// There is a very similar copy of this in os/timeout_test.go.
diff --git a/src/os/timeout_test.go b/src/os/timeout_test.go
index e0d2328ba1..5535beece8 100644
--- a/src/os/timeout_test.go
+++ b/src/os/timeout_test.go
@@ -282,10 +282,7 @@ func nextTimeout(actual time.Duration) (next time.Duration, ok bool) {
// duration by any significant margin. Try the next attempt with an arbitrary
// factor above that, so that our growth curve is at least exponential.
next = actual * 5 / 4
- if next > maxDynamicTimeout {
- return maxDynamicTimeout, true
- }
- return next, true
+ return min(next, maxDynamicTimeout), true
}
// There is a very similar copy of this in net/timeout_test.go.