diff --git a/test/parallel/test-fs-fsync.js b/test/parallel/test-fs-fsync.js index 006ec3fcc05cf6..3f43dd75450517 100644 --- a/test/parallel/test-fs-fsync.js +++ b/test/parallel/test-fs-fsync.js @@ -25,10 +25,16 @@ const assert = require('assert'); const fixtures = require('../common/fixtures'); const fs = require('fs'); +const path = require('path'); -const file = fixtures.path('a.js'); +const fileFixture = fixtures.path('a.js'); +const fileTemp = path.join(common.tmpDir, 'a.js'); -fs.open(file, 'a', 0o777, common.mustCall(function(err, fd) { +// Copy fixtures to temp. +common.refreshTmpDir(); +fs.copyFileSync(fileFixture, fileTemp); + +fs.open(fileFixture, 'a', 0o777, common.mustCall(function(err, fd) { assert.ifError(err); fs.fdatasyncSync(fd);