@@ -28,7 +28,7 @@ routes.set("/backend/timeout", async () => {
28
28
let error = await assertRejects ( ( ) => fetch ( 'https://http-me.glitch.me/test?wait=5000' , {
29
29
backend,
30
30
cacheOverride : new CacheOverride ( "pass" ) ,
31
- } ) ) ;
31
+ } ) , DOMException , 'HTTP response timeout' ) ;
32
32
console . timeEnd ( `fetch('https://http-me.glitch.me/test?wait=5000'` )
33
33
if ( error ) { return error }
34
34
return pass ( 'ok' )
@@ -62,14 +62,15 @@ routes.set("/backend/timeout", async () => {
62
62
if ( isRunningLocally ( ) ) {
63
63
return pass ( 'ok' ) ;
64
64
}
65
+ allowDynamicBackends ( true )
65
66
allowDynamicBackends ( {
66
- betweenBytesTimeout : 1_000 ,
67
- connectTimeout : 1_000 ,
68
- firstByteTimeout : 1_000
67
+ betweenBytesTimeout : 3_000 ,
68
+ connectTimeout : 3_000 ,
69
+ firstByteTimeout : 3_000
69
70
} ) ;
70
- console . time ( ` fetch('https://http-me.glitch.me/test?wait=5000'` )
71
- let error = await assertRejects ( ( ) => fetch ( 'https://http-me.glitch.me/test?wait=5000' ) ) ;
72
- console . timeEnd ( ` fetch('https://http-me.glitch.me/test?wait=5000'` )
71
+ let error = await assertResolves ( ( ) => fetch ( 'https://http-me.glitch.me/test?wait=2000' ) )
72
+ if ( error ) { return error }
73
+ error = await assertRejects ( ( ) => fetch ( 'https://http-me.glitch.me/test?wait=5000' ) , DOMException , 'HTTP response timeout' ) ;
73
74
if ( error ) { return error }
74
75
return pass ( 'ok' )
75
76
} ) ;
0 commit comments