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 <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
bzoz authored and addaleax committed Mar 29, 2020
1 parent bc28daa commit eb553a4
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 eb553a4

Please sign in to comment.