File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change 2
2
3
3
const { tspl } = require ( '@matteo.collina/tspl' )
4
4
const { test, after } = require ( 'node:test' )
5
+ const { setTimeout : sleep } = require ( 'node:timers/promises' )
5
6
const { createServer } = require ( 'node:http' )
6
7
const { once } = require ( 'node:events' )
7
8
const { tick : fastTimersTick } = require ( '../lib/util/timers' )
8
9
const { fetch, Agent, RetryAgent } = require ( '..' )
9
10
10
- test ( 'https://github.com/nodejs/undici/issues/3356' , async ( t ) => {
11
+ test ( 'https://github.com/nodejs/undici/issues/3356' , { skip : process . env . CITGM } , async ( t ) => {
11
12
t = tspl ( t , { plan : 3 } )
12
13
13
14
let shouldRetry = true
@@ -45,16 +46,16 @@ test('https://github.com/nodejs/undici/issues/3356', async (t) => {
45
46
46
47
fastTimersTick ( )
47
48
48
- setTimeout ( async ( ) => {
49
- try {
50
- t . equal ( response . status , 200 )
51
- // consume response
52
- await response . text ( )
53
- } catch ( err ) {
54
- t . equal ( err . name , 'TypeError' )
55
- t . equal ( err . cause . code , 'UND_ERR_REQ_RETRY ' )
56
- }
57
- } , 200 )
49
+ await sleep ( 500 )
50
+
51
+ try {
52
+ t . equal ( response . status , 200 )
53
+ // consume response
54
+ await response . text ( )
55
+ } catch ( err ) {
56
+ t . equal ( err . name , 'TypeError ' )
57
+ t . equal ( err . cause . code , 'UND_ERR_REQ_RETRY' )
58
+ }
58
59
59
60
await t . completed
60
61
} )
You can’t perform that action at this time.
0 commit comments