@@ -75,7 +75,7 @@ describe("fetch-gate", () => {
7575 // Server not ready yet
7676 }
7777 retries ++
78- await new Promise ( ( resolve ) => setTimeout ( resolve , 150 ) ) // Increased delay
78+ await new Promise ( ( resolve ) => setTimeout ( resolve , 250 ) ) // Increased delay for CI with low resources
7979 }
8080
8181 if ( ! serverReady ) {
@@ -100,10 +100,10 @@ describe("fetch-gate", () => {
100100 it ( "should create proxy instance with custom options" , ( ) => {
101101 const { proxy, getCircuitBreakerState } = createFetchGate ( {
102102 base : "https://api.example.com" ,
103- timeout : 5000 ,
103+ timeout : 15000 , // Increased timeout for CI with low resources
104104 circuitBreaker : {
105105 failureThreshold : 3 ,
106- resetTimeout : 30000 ,
106+ resetTimeout : 60000 , // Increased reset timeout for CI
107107 } ,
108108 } )
109109
@@ -182,7 +182,7 @@ describe("fetch-gate", () => {
182182 it ( "should handle timeouts" , async ( ) => {
183183 const proxyInstance = new FetchProxy ( {
184184 base : baseUrl ,
185- timeout : 80 , // Slightly longer timeout for CI stability
185+ timeout : 80 , // Keep original timeout for timeout test functionality
186186 } )
187187
188188 const req = new Request ( "http://example.com/test" )
@@ -215,7 +215,7 @@ describe("fetch-gate", () => {
215215 base : baseUrl ,
216216 circuitBreaker : {
217217 failureThreshold : 2 ,
218- resetTimeout : 1000 ,
218+ resetTimeout : 2000 , // Increased for CI with low resources
219219 enabled : true ,
220220 } ,
221221 } )
@@ -347,7 +347,7 @@ describe("fetch-gate", () => {
347347
348348 const circuitBreaker = new CircuitBreaker ( {
349349 failureThreshold : 1 ,
350- resetTimeout : 100 ,
350+ resetTimeout : 200 , // Increased for CI with low resources
351351 } )
352352
353353 // Trigger failure to open the circuit
@@ -369,7 +369,7 @@ describe("fetch-gate", () => {
369369 it ( "should reset failures after successful execution in HALF_OPEN state" , async ( ) => {
370370 const circuitBreaker = new CircuitBreaker ( {
371371 failureThreshold : 1 ,
372- resetTimeout : 150 , // Slightly longer for CI stability
372+ resetTimeout : 300 , // Increased for CI with low resources
373373 } )
374374
375375 // Trigger failure to open the circuit
@@ -380,7 +380,7 @@ describe("fetch-gate", () => {
380380 expect ( circuitBreaker . getState ( ) ) . toBe ( CircuitState . OPEN )
381381
382382 // Wait for reset timeout with a bit of buffer
383- await new Promise ( ( resolve ) => setTimeout ( resolve , 200 ) )
383+ await new Promise ( ( resolve ) => setTimeout ( resolve , 350 ) ) // Increased wait time for CI
384384
385385 // Execute a successful request
386386 await expect (
0 commit comments