mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 05:38:47 +02:00

This test previously squeezed 70+ test cases into one single file and has been constantly crashing on Windows with exit code 3221226505 and no stack trace. As it is already marked as flaky there is no way to understand which test case is failing and the Windows CI was constantly orange. This patch splits the test cases into different files so it's easier to find out which case is exactly failing and to be skipped. PR-URL: https://github.com/nodejs/node/pull/59408 Refs: https://github.com/nodejs/node/issues/56794 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
34 lines
963 B
JavaScript
34 lines
963 B
JavaScript
// This tests that cp() returns an error if attempt is made to copy socket.
|
|
|
|
import * as common from '../common/index.mjs';
|
|
import assert from 'node:assert';
|
|
import { cp, mkdirSync } from 'node:fs';
|
|
import { createServer } from 'node:net';
|
|
import { join } from 'node:path';
|
|
import { nextdir } from '../common/fs.js';
|
|
import tmpdir from '../common/tmpdir.js';
|
|
|
|
const isWindows = process.platform === 'win32';
|
|
if (isWindows) {
|
|
common.skip('No socket support on Windows');
|
|
}
|
|
|
|
// See https://github.com/nodejs/node/pull/48409
|
|
if (common.isInsideDirWithUnusualChars) {
|
|
common.skip('Test is borken in directories with unusual characters');
|
|
}
|
|
|
|
tmpdir.refresh();
|
|
|
|
{
|
|
const src = nextdir();
|
|
mkdirSync(src);
|
|
const dest = nextdir();
|
|
const sock = join(src, `${process.pid}.sock`);
|
|
const server = createServer();
|
|
server.listen(sock);
|
|
cp(sock, dest, common.mustCall((err) => {
|
|
assert.strictEqual(err.code, 'ERR_FS_CP_SOCKET');
|
|
server.close();
|
|
}));
|
|
}
|