Skip to content

Commit

Permalink
test: fix flaky fs-construct test
Browse files Browse the repository at this point in the history
Fixes: #33607

PR-URL: #33625
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
ronag authored and BridgeAR committed May 30, 2020
1 parent 2d071e7 commit b0b268f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions test/parallel/test-fs-stream-construct.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,14 @@ const examplePath = fixtures.path('x.txt');
});
});

const w = new WriteStream(`${tmpdir.path}/dummy2`,
{ flags: 'wx+', emitClose: true })
.on('error', common.mustCall((err) => {
assert.strictEqual(err.code, 'EEXIST');
w.destroy();
w.on('close', common.mustCall());
}));
fs.open(`${tmpdir.path}/dummy3`, 'wx+', common.mustCall((err) => {
assert(!err);
const w = new WriteStream(`${tmpdir.path}/dummy3`,
{ flags: 'wx+', emitClose: true })
.on('error', common.mustCall((err) => {
assert.strictEqual(err.code, 'EEXIST');
w.destroy();
w.on('close', common.mustCall());
}));
}));
}

0 comments on commit b0b268f

Please sign in to comment.