test: fix timeout not being cleared

PR-URL: https://github.com/nodejs/node/pull/54242
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
This commit is contained in:
Isaac-yz-Liu 2024-08-09 15:12:10 +09:30 committed by GitHub
parent 9e6c526f6c
commit 30f6c56e03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,11 +32,10 @@ const filename = tmpdir.resolve('big');
let count = 0;
const server = http.createServer((req, res) => {
let timeoutId;
assert.strictEqual(req.method, 'POST');
req.pause();
setTimeout(() => {
const timeoutId = setTimeout(() => {
req.resume();
}, 1000);