Skip to content

Commit 36c6d22

Browse files
bzozaddaleax
authored andcommitted
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: #21425 PR-URL: #32484 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 1b97d25 commit 36c6d22

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

test/async-hooks/async-hooks.status

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ prefix async-hooks
77
[true] # This section applies to all platforms
88

99
[$system==win32]
10-
# https://github.com/nodejs/node/issues/29852
11-
test-statwatcher: PASS,FLAKY
1210

1311
[$system==linux]
1412

test/async-hooks/test-statwatcher.js

-4
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ w1.on('change', common.mustCallAtLeast((curr, prev) => {
6464
// Wait until we get the write above.
6565
if (prev.size !== 0 || curr.size !== 5)
6666
return;
67-
// Remove listeners to make w1HookCount final
68-
w1.removeAllListeners('change');
6967

7068
setImmediate(() => {
7169
checkInvocations(statwatcher1,
@@ -81,8 +79,6 @@ w1.on('change', common.mustCallAtLeast((curr, prev) => {
8179
// Wait until we get the write above.
8280
if (prev.size !== 0 || curr.size !== 5)
8381
return;
84-
// Remove listeners to make w2HookCount final
85-
w2.removeAllListeners('change');
8682

8783
setImmediate(() => {
8884
checkInvocations(statwatcher1,

0 commit comments

Comments
 (0)