From 45fa3a0fd45e3642ea2cb50b6c3285ca18e90435 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 29 Aug 2024 17:22:16 +0200 Subject: [PATCH] fix: correctly ignore stdin in subprocesses --- core/tests/recovery-test/src/index.ts | 4 ++-- core/tests/revert-test/tests/revert-and-restart-en.test.ts | 4 ++-- core/tests/revert-test/tests/revert-and-restart.test.ts | 6 +++--- core/tests/upgrade-test/tests/upgrade.test.ts | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/tests/recovery-test/src/index.ts b/core/tests/recovery-test/src/index.ts index f130bb6a09f..be74c010ed3 100644 --- a/core/tests/recovery-test/src/index.ts +++ b/core/tests/recovery-test/src/index.ts @@ -112,7 +112,7 @@ export async function executeCommandWithLogs(command: string, logsPath: string) const logs = await fs.open(logsPath, 'w'); const childProcess = spawn(command, { cwd: process.env.ZKSYNC_HOME!!, - stdio: [null, logs.fd, logs.fd], + stdio: ['ignore', logs.fd, logs.fd], shell: true }); try { @@ -194,7 +194,7 @@ export class NodeProcess { let childProcess = runExternalNodeInBackground({ components: [components], - stdio: [null, logs.fd, logs.fd], + stdio: ['ignore', logs.fd, logs.fd], cwd: pathToHome, env, useZkInception, diff --git a/core/tests/revert-test/tests/revert-and-restart-en.test.ts b/core/tests/revert-test/tests/revert-and-restart-en.test.ts index d0d129fbf13..bd5dca6d270 100644 --- a/core/tests/revert-test/tests/revert-and-restart-en.test.ts +++ b/core/tests/revert-test/tests/revert-and-restart-en.test.ts @@ -208,7 +208,7 @@ class MainNode { } let proc = runServerInBackground({ components: [components], - stdio: [null, logs, logs], + stdio: ['ignore', logs, logs], cwd: pathToHome, env: env, useZkInception: fileConfig.loadFromFile, @@ -281,7 +281,7 @@ class ExtNode { // Run server in background. let proc = runExternalNodeInBackground({ - stdio: [null, logs, logs], + stdio: ['ignore', logs, logs], cwd: pathToHome, env: env, useZkInception: fileConfig.loadFromFile, diff --git a/core/tests/revert-test/tests/revert-and-restart.test.ts b/core/tests/revert-test/tests/revert-and-restart.test.ts index ed56e58cc24..17669bca4f1 100644 --- a/core/tests/revert-test/tests/revert-and-restart.test.ts +++ b/core/tests/revert-test/tests/revert-and-restart.test.ts @@ -153,7 +153,7 @@ describe('Block reverting test', function () { // Run server in background. serverProcess = runServerInBackground({ components: [components], - stdio: [null, logs, logs], + stdio: ['ignore', logs, logs], cwd: pathToHome, useZkInception: fileConfig.loadFromFile, chain: fileConfig.chain @@ -270,7 +270,7 @@ describe('Block reverting test', function () { // Run server. serverProcess = runServerInBackground({ components: [components], - stdio: [null, logs, logs], + stdio: ['ignore', logs, logs], cwd: pathToHome, useZkInception: fileConfig.loadFromFile, chain: fileConfig.chain @@ -321,7 +321,7 @@ describe('Block reverting test', function () { // Run again. serverProcess = runServerInBackground({ components: [components], - stdio: [null, logs, logs], + stdio: ['ignore', logs, logs], cwd: pathToHome, useZkInception: fileConfig.loadFromFile, chain: fileConfig.chain diff --git a/core/tests/upgrade-test/tests/upgrade.test.ts b/core/tests/upgrade-test/tests/upgrade.test.ts index 3f636f5b455..ffa28e4f109 100644 --- a/core/tests/upgrade-test/tests/upgrade.test.ts +++ b/core/tests/upgrade-test/tests/upgrade.test.ts @@ -138,7 +138,7 @@ describe('Upgrade test', function () { // Run server in background. runServerInBackground({ components: serverComponents, - stdio: [null, logs, logs], + stdio: ['ignore', logs, logs], cwd: pathToHome, useZkInception: fileConfig.loadFromFile, chain: fileConfig.chain @@ -346,7 +346,7 @@ describe('Upgrade test', function () { // Run again. runServerInBackground({ components: serverComponents, - stdio: [null, logs, logs], + stdio: ['ignore', logs, logs], cwd: pathToHome, useZkInception: fileConfig.loadFromFile, chain: fileConfig.chain