From 6364faa0ff928bc5652f6422ed09ec3fa7a2dc2e Mon Sep 17 00:00:00 2001 From: Isaac Liu Date: Fri, 2 Aug 2024 17:20:13 +0930 Subject: [PATCH] test: fix timeout not being cleared --- test/parallel/test-pipe-file-to-http.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/parallel/test-pipe-file-to-http.js b/test/parallel/test-pipe-file-to-http.js index 6c1244427d9fa7..82bdbe6a832a98 100644 --- a/test/parallel/test-pipe-file-to-http.js +++ b/test/parallel/test-pipe-file-to-http.js @@ -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);