| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1f6551d commit c0918f0
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,7 +48,10 @@ watcher.on('change', function(event, filename) { | |||
| 48 | 48 | } | |
| 49 | 49 | }); | |
| 50 | 50 | ||
| 51 | - fs.writeFileSync(childrenAbsolutePath, 'world'); | ||
| 51 | + // Do the write with a delay to ensure that the OS is ready to notify us. | ||
| 52 | + setTimeout(() => { | ||
| 53 | + fs.writeFileSync(childrenAbsolutePath, 'world'); | ||
| 54 | + }, common.platformTimeout(200)); | ||
| 52 | 55 | ||
| 53 | 56 | process.once('exit', function() { | |
| 54 | 57 | assert(watcherClosed, 'watcher Object was not closed'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,8 +44,11 @@ watcher.on('change', function(event, filename) { | |||
| 44 | 44 | } | |
| 45 | 45 | }); | |
| 46 | 46 | ||
| 47 | - fs.mkdirSync(filePath); | ||
| 48 | - fs.writeFileSync(childrenAbsolutePath, 'world'); | ||
| 47 | + // Do the write with a delay to ensure that the OS is ready to notify us. | ||
| 48 | + setTimeout(() => { | ||
| 49 | + fs.mkdirSync(filePath); | ||
| 50 | + fs.writeFileSync(childrenAbsolutePath, 'world'); | ||
| 51 | + }, common.platformTimeout(200)); | ||
| 49 | 52 | ||
| 50 | 53 | process.once('exit', function() { | |
| 51 | 54 | assert(watcherClosed, 'watcher Object was not closed'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,7 +39,10 @@ watcher.on('change', function(event, filename) { | |||
| 39 | 39 | } | |
| 40 | 40 | }); | |
| 41 | 41 | ||
| 42 | - fs.writeFileSync(testFile, 'world'); | ||
| 42 | + // Do the write with a delay to ensure that the OS is ready to notify us. | ||
| 43 | + setTimeout(() => { | ||
| 44 | + fs.writeFileSync(testFile, 'world'); | ||
| 45 | + }, common.platformTimeout(200)); | ||
| 43 | 46 | ||
| 44 | 47 | process.once('exit', function() { | |
| 45 | 48 | assert(watcherClosed, 'watcher Object was not closed'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,4 +42,9 @@ watcher.on('change', common.mustCallAtLeast(async (event, filename) => { | |||
| 42 | 42 | process.on('exit', function() { | |
| 43 | 43 | assert(watcherClosed, 'watcher Object was not closed'); | |
| 44 | 44 | }); | |
| 45 | - fs.writeFileSync(filePath, 'content'); | ||
| 45 | + | ||
| 46 | + // Do the write with a delay to ensure that the OS is ready to notify us. | ||
| 47 | + (async () => { | ||
| 48 | + await setTimeout(200); | ||
| 49 | + fs.writeFileSync(filePath, 'content'); | ||
| 50 | + })().then(common.mustCall()); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,4 +32,7 @@ const watcher = watch(tmpDir, { recursive: true }, common.mustCall((eventType, _ | |||
| 32 | 32 | assert.strictEqual(join(tmpDir, _filename), filename); | |
| 33 | 33 | })); | |
| 34 | 34 | ||
| 35 | - writeFileSync(filename, 'foobar2'); | ||
| 35 | + // Do the write with a delay to ensure that the OS is ready to notify us. | ||
| 36 | + setTimeout(() => { | ||
| 37 | + writeFileSync(filename, 'foobar2'); | ||
| 38 | + }, common.platformTimeout(200)); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,4 +39,7 @@ watcher.on('change', common.mustCallAtLeast(function(event, filename) { | |||
| 39 | 39 | } | |
| 40 | 40 | })); | |
| 41 | 41 | ||
| 42 | - fs.writeFileSync(testFile, 'hello'); | ||
| 42 | + // Do the write with a delay to ensure that the OS is ready to notify us. | ||
| 43 | + setTimeout(() => { | ||
| 44 | + fs.writeFileSync(testFile, 'hello'); | ||
| 45 | + }, common.platformTimeout(200)); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments