@@ -512,25 +512,24 @@ describe('Apify Node', () => {
512
512
513
513
describe ( 'api calls' , ( ) => {
514
514
it ( 'should retry the specified number of times with exponential delays' , async ( ) => {
515
- const retryAbleCodes = [ 429 , 500 ] ;
516
515
const storeId = 'yTfMu13hDFe9bRjx6' ;
517
516
const recordKey = 'INPUT' ;
518
517
519
- for ( const code of retryAbleCodes ) {
520
- const scope = nock ( 'https://api.apify.com' )
521
- . get ( `/v2/key-value-stores/${ storeId } /records/${ recordKey } ` )
522
- . reply ( code )
523
- . get ( `/v2/key-value-stores/${ storeId } /records/${ recordKey } ` )
524
- . reply ( 200 ) ;
525
-
526
- const getKeyValueStoreRecordWorkflow = require ( './workflows/key-value-stores/get-key-value-store-record.workflow.json' ) ;
527
- await executeWorkflow ( {
528
- credentialsHelper,
529
- workflow : getKeyValueStoreRecordWorkflow ,
530
- } ) ;
518
+ const scope = nock ( 'https://api.apify.com' )
519
+ . get ( `/v2/key-value-stores/${ storeId } /records/${ recordKey } ` )
520
+ . reply ( 500 )
521
+ . get ( `/v2/key-value-stores/${ storeId } /records/${ recordKey } ` )
522
+ . reply ( 429 )
523
+ . get ( `/v2/key-value-stores/${ storeId } /records/${ recordKey } ` )
524
+ . reply ( 200 ) ;
525
+
526
+ const getKeyValueStoreRecordWorkflow = require ( './workflows/key-value-stores/get-key-value-store-record.workflow.json' ) ;
527
+ await executeWorkflow ( {
528
+ credentialsHelper,
529
+ workflow : getKeyValueStoreRecordWorkflow ,
530
+ } ) ;
531
531
532
- expect ( scope . isDone ( ) ) . toBe ( true ) ;
533
- }
532
+ expect ( scope . isDone ( ) ) . toBe ( true ) ;
534
533
} ) ;
535
534
} ) ;
536
535
} ) ;
0 commit comments