Skip to content

Commit b0b268f

Browse files
ronagBridgeAR
authored andcommitted
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>
1 parent 2d071e7 commit b0b268f

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

test/parallel/test-fs-stream-construct.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,14 @@ const examplePath = fixtures.path('x.txt');
199199
});
200200
});
201201

202-
const w = new WriteStream(`${tmpdir.path}/dummy2`,
203-
{ flags: 'wx+', emitClose: true })
204-
.on('error', common.mustCall((err) => {
205-
assert.strictEqual(err.code, 'EEXIST');
206-
w.destroy();
207-
w.on('close', common.mustCall());
208-
}));
202+
fs.open(`${tmpdir.path}/dummy3`, 'wx+', common.mustCall((err) => {
203+
assert(!err);
204+
const w = new WriteStream(`${tmpdir.path}/dummy3`,
205+
{ flags: 'wx+', emitClose: true })
206+
.on('error', common.mustCall((err) => {
207+
assert.strictEqual(err.code, 'EEXIST');
208+
w.destroy();
209+
w.on('close', common.mustCall());
210+
}));
211+
}));
209212
}

0 commit comments

Comments
 (0)