diff --git a/test/utils.js b/test/utils.js index d8896c1d306..9bf082942c1 100644 --- a/test/utils.js +++ b/test/utils.js @@ -231,4 +231,8 @@ function atomicWriteFileSync(filePath, contents) { const stagingPath = filePath + '_'; fs.writeFileSync(stagingPath, contents); fs.renameSync(stagingPath, filePath); + // It appears that on MacOS, it sometimes takes long for the file system to update + const file = fs.openSync(filePath); + fs.fsyncSync(file); + fs.closeSync(file); }