Skip to content

Commit

Permalink
test: reduce sequential/test-fs-watch flakiness
Browse files Browse the repository at this point in the history
The fs.watch test's write events sometimes aren't produced on OS X,
possibly because of a fsevents race condition. This patch gives delays
the writing a total of 20ms, which makes the test pass consistently.

PR-URL: #1275
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
silverwind committed Mar 27, 2015
1 parent 36f017a commit 955c150
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/sequential/test-fs-watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ assert.doesNotThrow(

setTimeout(function() {
fs.writeFileSync(filepathOne, 'world');
}, 10);
}, 20);


process.chdir(testDir);
Expand All @@ -79,7 +79,7 @@ assert.doesNotThrow(

setTimeout(function() {
fs.writeFileSync(filepathTwoAbs, 'pardner');
}, 10);
}, 20);

try { fs.unlinkSync(filepathThree); } catch (e) {}
try { fs.mkdirSync(testsubdir, 0700); } catch (e) {}
Expand All @@ -103,7 +103,7 @@ assert.doesNotThrow(
setTimeout(function() {
var fd = fs.openSync(filepathThree, 'w');
fs.closeSync(fd);
}, 10);
}, 20);

// https://github.com/joyent/node/issues/2293 - non-persistent watcher should
// not block the event loop
Expand Down

0 comments on commit 955c150

Please sign in to comment.