From db07b9d00cb97bfebaac6907726a309e76237ba8 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Wed, 25 Mar 2020 15:05:22 +0100 Subject: [PATCH] test: unflake async-hooks/test-statwatcher On Windows 2016 under high load further change events can be emitted after writing the 5 bytes is reported. Updating the mtime of the file can be reported as a separate change. This will increase the "before" count, but not the "w1HookCount" since we removed the listener. This makes the test keep the listeners until the end of the test. Fixes: https://github.com/nodejs/node/issues/21425 --- test/async-hooks/async-hooks.status | 2 -- test/async-hooks/test-statwatcher.js | 4 ---- 2 files changed, 6 deletions(-) diff --git a/test/async-hooks/async-hooks.status b/test/async-hooks/async-hooks.status index 9ad85147db2b6b..7f36d5a78a6e2b 100644 --- a/test/async-hooks/async-hooks.status +++ b/test/async-hooks/async-hooks.status @@ -7,8 +7,6 @@ prefix async-hooks [true] # This section applies to all platforms [$system==win32] -# https://github.com/nodejs/node/issues/29852 -test-statwatcher: PASS,FLAKY [$system==linux] diff --git a/test/async-hooks/test-statwatcher.js b/test/async-hooks/test-statwatcher.js index 0c1e245c4e21df..b8651ab8e0431e 100644 --- a/test/async-hooks/test-statwatcher.js +++ b/test/async-hooks/test-statwatcher.js @@ -64,8 +64,6 @@ w1.on('change', common.mustCallAtLeast((curr, prev) => { // Wait until we get the write above. if (prev.size !== 0 || curr.size !== 5) return; - // Remove listeners to make w1HookCount final - w1.removeAllListeners('change'); setImmediate(() => { checkInvocations(statwatcher1, @@ -81,8 +79,6 @@ w1.on('change', common.mustCallAtLeast((curr, prev) => { // Wait until we get the write above. if (prev.size !== 0 || curr.size !== 5) return; - // Remove listeners to make w2HookCount final - w2.removeAllListeners('change'); setImmediate(() => { checkInvocations(statwatcher1,