Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6fa142d

Browse filesBrowse files
LiviaMedeirostargos
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 0d9c345 commit 6fa142d
Copy full SHA for 6fa142d

File tree

Expand file treeCollapse file tree

1 file changed

+6
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-2
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-fs-cp.mjs
+6-2Lines 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+
const src = nextdir();
279+
mkdirSync(src);
278280
const dest = nextdir();
279-
const sock = `${process.pid}.sock`;
281+
const sock = join(src, `${process.pid}.sock`);
280282
const server = 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+
const src = nextdir();
602+
mkdirSync(src);
599603
const dest = nextdir();
600-
const sock = `${process.pid}.sock`;
604+
const sock = join(src, `${process.pid}.sock`);
601605
const server = net.createServer();
602606
server.listen(sock);
603607
cp(sock, dest, mustCall((err) => {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.