You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Investigate flaky test-regress-GH-4027 on Windows #13800
fsIssues and PRs related to file-system APIs and the fs module.testIssues and PRs related to Node.js core tests and test infrastructure.windowsIssues and PRs related to the Windows platform.
not ok 387 sequential/test-regress-GH-4027 --- duration_ms: 5.421 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\1\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\1\VS_VERSION\vs2015\label\win2012r2\test\common\index.js:517:15) at emitTwo (events.js:125:13) at StatWatcher.emit (events.js:213:7) at StatWatcher._handle.onchange (fs.js:1454:10)
/cc @nodejs/testing @nodejs/platform-windows
Perhaps a race condition triggered by system load, which probably explains why it's in sequential and not parallel in the first place?
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 watchFile are able to get the first state of the file, so watchFile behaves as if the file doesn't exist and calls the callback with prev.nlink and curr.nlink at 0.
Increasing the delay before unlinking to 300ms and calling setTimeout after watchFile caused it to stop reproducing.
fsIssues and PRs related to file-system APIs and the fs module.testIssues and PRs related to Node.js core tests and test infrastructure.windowsIssues and PRs related to the Windows platform.
Type
No type
Projects
No projects
Milestone
No milestone
Relationships
None yet
Development
No branches or pull requests
Issue actions
You can’t perform that action at this time.
✕
Wait! Don't Go Yet 🚀
Get our FREE eBook "10 Programming Tips That Changed Everything" when you subscribe!
Activity
refack commentedon Jun 19, 2017
Yes this is a timing balancing act, supposed to do
fs.writeFileSyncsetTimeout(fs.unlinkSync, 100fs.watchFile(filename, { interval: 50 }Trott commentedon Jun 25, 2017
Another one:
https://ci.nodejs.org/job/node-test-binary-windows/9429/RUN_SUBSET=3,VS_VERSION=vs2015,label=win2012r2/console
jaimecbernardo commentedon Jun 30, 2017
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
test,fs: delay unlink in test-regress-GH-4027.js
test,fs: delay unlink in test-regress-GH-4027.js
test,fs: delay unlink in test-regress-GH-4027.js
test,fs: delay unlink in test-regress-GH-4027.js
test,fs: delay unlink in test-regress-GH-4027.js
test,fs: delay unlink in test-regress-GH-4027.js
test,fs: delay unlink in test-regress-GH-4027.js