Skip to content

Commit

Permalink
test: unflake async-hooks/test-statwatcher
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
bzoz authored and addaleax committed Mar 30, 2020
1 parent 1b97d25 commit 36c6d22
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
2 changes: 0 additions & 2 deletions test/async-hooks/async-hooks.status
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
4 changes: 0 additions & 4 deletions test/async-hooks/test-statwatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 36c6d22

Please sign in to comment.