Change-Id: I309d93d6ebf0feb462217a344d5f02c190220752
Reviewed-on: https://go-review.googlesource.com/c/go/+/661737
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
// 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.
// 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.