From 2f68a74702f8b3dfe9ff3718ad928472db04d529 Mon Sep 17 00:00:00 2001 From: Isaac-yz-Liu <59156541+Isaac-yz-Liu@users.noreply.github.com> Date: Fri, 9 Aug 2024 15:12:10 +0930 Subject: [PATCH] test: fix timeout not being cleared MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/54242 Reviewed-By: Michaƫl Zasso Reviewed-By: Jake Yuesong Li Reviewed-By: Luigi Pinca Reviewed-By: Tierney Cyren --- 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);