Repository navigation
Investigate flaky test-regress-GH-4027 on Windows #13800
Copy link
Copy link
Closed
Labels
fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.testIssues and PRs related to Node.js core tests and test infrastructure.Issues and PRs related to Node.js core tests and test infrastructure.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Description
Activity
- addedfsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.testIssues and PRs related to Node.js core tests and test infrastructure.Issues and PRs related to Node.js core tests and test infrastructure.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
on Jun 19, 2017 Perhaps a race condition triggered by system load, which probably explains why it's in sequential and not parallel in the first place?
Yes this is a timing balancing act, supposed to do
fs.writeFileSyncsetTimeout(fs.unlinkSync, 100fs.watchFile(filename, { interval: 50 }
Another one:
not ok 387 sequential/test-regress-GH-4027 --- duration_ms: 6.187 severity: fail stack: |- assert.js:60 throw new errors.AssertionError({ ^ AssertionError [ERR_ASSERTION]: 0 === 1 at StatWatcher.<anonymous> (c:\workspace\node-test-binary-windows\RUN_SUBSET\3\VS_VERSION\vs2015\label\win2012r2\test\sequential\test-regress-GH-4027.js:35:10) at StatWatcher.<anonymous> (c:\workspace\node-test-binary-windows\RUN_SUBSET\3\VS_VERSION\vs2015\label\win2012r2\test\common\index.js:520:15) at emitTwo (events.js:125:13) at StatWatcher.emit (events.js:213:7) at StatWatcher._handle.onchange (fs.js:1454:10) ...
Investigated this issue. Managed to replicate it on a VM by capping the CPU. The issue seems to be that the watched file is getting deleted before the internals of
watchFileare able to get the first state of the file, sowatchFilebehaves as if the file doesn't exist and calls the callback withprev.nlinkandcurr.nlinkat 0.Increasing the delay before unlinking to 300ms and calling
setTimeoutafterwatchFilecaused it to stop reproducing.Created a PR: #14010
- added a commit that references this issue
on Jul 11, 2017 - added a commit that references this issue
on Jul 18, 2017 - added a commit that references this issue
on Jul 19, 2017 - added a commit that references this issue
on Jul 27, 2026
Metadata
Metadata
Assignees
Labels
fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.testIssues and PRs related to Node.js core tests and test infrastructure.Issues and PRs related to Node.js core tests and test infrastructure.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
https://ci.nodejs.org/job/node-test-binary-windows/9310/RUN_SUBSET=1,VS_VERSION=vs2015,label=win2012r2/console
/cc @nodejs/testing @nodejs/platform-windows
Perhaps a race condition triggered by system load, which probably explains why it's in
sequentialand notparallelin the first place?