Skip to content

Commit b344e74

Browse files
LiviaMedeirosdanielleadams
authored andcommitted
test: move socket from CWD to temporary directory
PR-URL: #46863 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent b25ee52 commit b344e74

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎test/parallel/test-fs-cp.mjs‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,10 @@ function nextdir() {
275275

276276
// It throws an error if attempt is made to copy socket.
277277
if(!isWindows){
278+
constsrc=nextdir();
279+
mkdirSync(src);
278280
constdest=nextdir();
279-
constsock=`${process.pid}.sock`;
281+
constsock=join(src,`${process.pid}.sock`);
280282
constserver=net.createServer();
281283
server.listen(sock);
282284
assert.throws(
@@ -596,8 +598,10 @@ if (!isWindows) {
596598

597599
// It returns an error if attempt is made to copy socket.
598600
if(!isWindows){
601+
constsrc=nextdir();
602+
mkdirSync(src);
599603
constdest=nextdir();
600-
constsock=`${process.pid}.sock`;
604+
constsock=join(src,`${process.pid}.sock`);
601605
constserver=net.createServer();
602606
server.listen(sock);
603607
cp(sock,dest,mustCall((err)=>{

0 commit comments

Comments
 (0)