Skip to content

Commit 51a27b7

Browse files
authored
chore(test): issue 3969 (#5005)
Signed-off-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
1 parent a434502 commit 51a27b7

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

test/issue-3356.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
const { tspl } = require('@matteo.collina/tspl')
44
const { test, after } = require('node:test')
5-
const { setTimeout: sleep } = require('node:timers/promises')
65
const { createServer } = require('node:http')
76
const { once } = require('node:events')
87
const { tick: fastTimersTick } = require('../lib/util/timers')
@@ -30,24 +29,23 @@ test('https://github.com/nodejs/undici/issues/3356', { skip: process.env.CITGM }
3029

3130
await once(server, 'listening')
3231

32+
const agent = new RetryAgent(new Agent({ bodyTimeout: 50 }), {
33+
errorCodes: ['UND_ERR_BODY_TIMEOUT']
34+
})
35+
3336
after(async () => {
37+
await agent.close()
3438
server.close()
3539

3640
await once(server, 'close')
3741
})
3842

39-
const agent = new RetryAgent(new Agent({ bodyTimeout: 50 }), {
40-
errorCodes: ['UND_ERR_BODY_TIMEOUT']
41-
})
42-
4343
const response = await fetch(`http://localhost:${server.address().port}`, {
4444
dispatcher: agent
4545
})
4646

4747
fastTimersTick()
4848

49-
await sleep(500)
50-
5149
try {
5250
t.equal(response.status, 200)
5351
// consume response

0 commit comments

Comments
 (0)