File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1990,16 +1990,16 @@ test('totalTimeout with retryOnTimeout: true caps total time across retries', as
19901990
19911991 const customFetch : typeof fetch = async ( ) => {
19921992 requestCount ++ ;
1993- // Each attempt takes 300ms , exceeding the 200ms per-attempt timeout
1994- await delay ( 300 ) ;
1993+ // Each attempt takes 600ms , exceeding the 400ms per-attempt timeout
1994+ await delay ( 600 ) ;
19951995 return new Response ( 'ok' ) ;
19961996 } ;
19971997
19981998 await t . throwsAsync (
19991999 ky ( 'https://example.com' , {
20002000 fetch : customFetch ,
2001- timeout : 200 ,
2002- totalTimeout : 500 ,
2001+ timeout : 400 ,
2002+ totalTimeout : 1500 ,
20032003 retry : {
20042004 limit : 10 ,
20052005 retryOnTimeout : true ,
@@ -2011,8 +2011,8 @@ test('totalTimeout with retryOnTimeout: true caps total time across retries', as
20112011 } ,
20122012 ) ;
20132013
2014- // Each attempt times out at ~200ms . Within 500ms totalTimeout, 2-3 attempts fit.
2015- t . true ( requestCount >= 2 && requestCount <= 3 ) ;
2014+ // Each attempt times out at ~400ms . Within 1500ms totalTimeout, 2-4 attempts fit.
2015+ t . true ( requestCount >= 2 && requestCount <= 4 ) ;
20162016} ) ;
20172017
20182018test ( 'NetworkError wraps fetch network errors' , async t => {
You can’t perform that action at this time.
0 commit comments