@@ -67,7 +67,7 @@ describe('Artifact', () => {
6767
6868 expect ( axiosRetry ) . toHaveBeenCalledWith ( axios , {
6969 retries : 3 ,
70-
70+ onRetry : expect . any ( Function ) ,
7171 retryCondition : expect . matchesPredicate (
7272 // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
7373 ( retryConditionFn : Function ) => {
@@ -79,21 +79,18 @@ describe('Artifact', () => {
7979 // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
8080 retryDelay : expect . matchesPredicate ( ( retryDelayFn : Function ) => {
8181 // Make sure the retry delays follow exponential backoff
82- // and the final retry happens after at least 1 minute total
83- // (in this case, at least 70 seconds).
84- // Axios randomly adds an extra 0-20% of jitter to each delay.
85- // Test upper bounds as well to ensure the workflow completes reasonably quickly
86- // (in this case, no more than 84 seconds total).
82+ // Axios randomly adds an extra 0-20% of jitter to each delay:
83+ // https://github.com/softonic/axios-retry/blob/3f9557920b816ec4f692870d89939ae739d7f8ed/src/index.ts#L169
8784 const firstRetryDelay = retryDelayFn . call ( this , 0 ) ;
8885 const secondRetryDelay = retryDelayFn . call ( this , 1 ) ;
8986 const thirdRetryDelay = retryDelayFn . call ( this , 2 ) ;
9087 return (
91- 10000 <= firstRetryDelay &&
92- firstRetryDelay <= 12000 &&
93- 20000 <= secondRetryDelay &&
94- secondRetryDelay <= 24000 &&
95- 40000 <= thirdRetryDelay &&
96- thirdRetryDelay <= 48000
88+ 2000 <= firstRetryDelay &&
89+ firstRetryDelay <= 2400 &&
90+ 4000 <= secondRetryDelay &&
91+ secondRetryDelay <= 4800 &&
92+ 8000 <= thirdRetryDelay &&
93+ thirdRetryDelay <= 9600
9794 ) ;
9895 } ) ,
9996 shouldResetTimeout : true ,
0 commit comments