Skip to content

Commit 03a5c5a

Browse files
jaimecbernardoMylesBorins
authored andcommitted
test,fs: delay unlink in test-regress-GH-4027.js
The sequential/test-regress-GH-4027 test is flaky with an increased system load, failing when the watched file is unlinked before the first state of the watched file is retrieved. After increasing the delay before unlinking and calling setTimeout after watchFile, the flakiness stopped reproducing. PR-URL: #14010 Fixes: #13800 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
1 parent c5a427f commit 03a5c5a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

test/sequential/test-regress-GH-4027.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ common.refreshTmpDir();
88

99
const filename = path.join(common.tmpDir, 'watched');
1010
fs.writeFileSync(filename, 'quis custodiet ipsos custodes');
11-
setTimeout(fs.unlinkSync, 100, filename);
1211

1312
fs.watchFile(filename, { interval: 50 }, common.mustCall(function(curr, prev) {
1413
assert.strictEqual(prev.nlink, 1);
1514
assert.strictEqual(curr.nlink, 0);
1615
fs.unwatchFile(filename);
1716
}));
17+
18+
setTimeout(fs.unlinkSync, common.platformTimeout(300), filename);

0 commit comments

Comments
 (0)