Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Commit 39f749d

Browse files
committed
updating tests for undici timeouts
1 parent ac92208 commit 39f749d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ module.exports = (opts) => {
9292
if (err.code === 'ECONNREFUSED' || err.code === 'ERR_HTTP2_STREAM_CANCEL') {
9393
res.statusCode = 503
9494
res.end('Service Unavailable')
95-
} else if (err.code === 'ECONNRESET' || err.code === 'UND_ERR_REQUEST_TIMEOUT') {
95+
} else if (err.code === 'ECONNRESET' || err.code === 'UND_ERR_HEADERS_TIMEOUT' || err.code === 'UND_ERR_BODY_TIMEOUT') {
9696
res.statusCode = 504
9797
res.end(err.message)
9898
} else {

test/5.undici.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('undici', () => {
1515
base: 'http://127.0.0.1:3000',
1616
undici: {
1717
pipelining: 10,
18-
requestTimeout: 100
18+
headersTimeout: 100
1919
}
2020
})
2121
close = fastProxy.close
@@ -57,7 +57,7 @@ describe('undici', () => {
5757
})
5858
service.get('/service/timeout', async (req, res) => {
5959
await sleep(200)
60-
res.send()
60+
res.send('OK')
6161
})
6262

6363
service.start(3000).then(() => done())

0 commit comments

Comments
 (0)