You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minExpectedTimeToMaxRetries:= (retryOptions.MaxRetryDelay*time.Duration(retryOptions.MaxTries-3)) /2// a very rough approximation, of a lower bound, given assumption that we hit the cap early in the retry count, and pessimistically assuming that all get halved by random jitter calcs
c.Assert(err, chk.NotNil) // Ensure we ended with an error
175
-
c.Assert(response, chk.IsNil) // Ensure we ended without a valid response
176
-
c.Assert(retrytestPolicyFactory.try, chk.Equals, retryOptions.MaxTries) // Ensure the operation ends with the exact right number of tries
176
+
c.Assert(err, chk.NotNil) // Ensure we ended with an error
177
+
c.Assert(response, chk.IsNil) // Ensure we ended without a valid response
178
+
c.Assert(retrytestPolicyFactory.try, chk.Equals, retryOptions.MaxTries) // Ensure the operation ends with the exact right number of tries
179
+
c.Assert(time.Since(start) >minExpectedTimeToMaxRetries, chk.Equals, true) // Ensure it took about as long to get here as we expect (bearing in mind randomness in the jitter), as a basic sanity check of our delay duration calculations
177
180
caseretryTestScenarioRetryUntilOperationCancel:
178
181
c.Assert(err, chk.Equals, context.Canceled) // Ensure we ended due to cancellation
179
182
c.Assert(response, chk.IsNil) // Ensure we ended without a valid response
0 commit comments