Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: avoid generating snapshot blobs outside tmpdir #45137

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion test/parallel/test-inspect-address-in-use.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const fixtures = require('../common/fixtures');
const entry = fixtures.path('empty.js');
const { Worker } = require('worker_threads');

const tmpdir = require('../common/tmpdir');
tmpdir.refresh();

function testOnServerListen(fn) {
const server = createServer((socket) => {
socket.end('echo');
Expand All @@ -24,7 +27,10 @@ function testOnServerListen(fn) {
function testChildProcess(getArgs, exitCode) {
testOnServerListen((server) => {
const { port } = server.address();
const child = spawnSync(process.execPath, getArgs(port));
const child = spawnSync(process.execPath, getArgs(port), {
// Generates snapshot blobs in the tmpdir.
cwd: tmpdir.path,
});
const stderr = child.stderr.toString().trim();
const stdout = child.stdout.toString().trim();
console.log('[STDERR]');
Expand Down