From 955c1508dab1d7f3e4684e6f6b0bd40218e8c297 Mon Sep 17 00:00:00 2001 From: Roman Reiss Date: Thu, 26 Mar 2015 20:01:17 +0100 Subject: [PATCH] test: reduce sequential/test-fs-watch flakiness 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: https://github.com/iojs/io.js/pull/1275 Reviewed-By: Ben Noordhuis --- test/sequential/test-fs-watch.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/sequential/test-fs-watch.js b/test/sequential/test-fs-watch.js index 7c86e211620006..d92a10cd808a10 100644 --- a/test/sequential/test-fs-watch.js +++ b/test/sequential/test-fs-watch.js @@ -56,7 +56,7 @@ assert.doesNotThrow( setTimeout(function() { fs.writeFileSync(filepathOne, 'world'); -}, 10); +}, 20); process.chdir(testDir); @@ -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) {} @@ -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