From 5f55b5d29dfa4068c8003fbfc7f119306a525aa4 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Sun, 9 Jan 2022 07:23:45 +0100 Subject: [PATCH] Flush atomic file writes --- test/utils.js | 4 ++++ 1 file changed, 4 insertions(+) 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); }