Sitelet https://web.archive.org/web/20211206132039/https://github.com/nodejs/node/commit/b0b268f5a2
Skip to content
Permalink
Browse files
test: fix flaky fs-construct test
Fixes: #33607

PR-URL: #33625
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
ronag authored and BridgeAR committed May 30, 2020
1 parent 2d071e7 commit b0b268f5a247e2e6aabd63cab60cef291665201b
Showing with 10 additions and 7 deletions.
  1. +10 −7 test/parallel/test-fs-stream-construct.js
@@ -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.