test: do not open fixture files for writing

test-fs-fsync makes a copy of a fixture file, but then doesn't do
anything with it and instead operates on the original fixture file. This
appears to be in error, and this change fixes that.

PR-URL: https://github.com/nodejs/node/pull/17808
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Rich Trott 2017-12-21 14:38:02 -08:00
parent ab5a2aba38
commit 92fc14a459

View File

@ -34,7 +34,7 @@ const fileTemp = path.join(common.tmpDir, 'a.js');
common.refreshTmpDir();
fs.copyFileSync(fileFixture, fileTemp);
fs.open(fileFixture, 'a', 0o777, common.mustCall(function(err, fd) {
fs.open(fileTemp, 'a', 0o777, common.mustCall(function(err, fd) {
assert.ifError(err);
fs.fdatasyncSync(fd);