From 0d1abb6d759907c6f31e6bc8fd8814c256bc1aec Mon Sep 17 00:00:00 2001 From: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com> Date: Tue, 2 Jun 2026 18:42:14 +0200 Subject: [PATCH] ci: explicitly exit Node lint scripts to fix CI hang (#22794) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The three Node scripts that run under `setup-node` (lint-lockfile, lint-runtime, setup-corepack) finish their main work but the Node process does not exit — the event loop is kept alive by an outstanding handle from one of the upstream libraries. In CI this causes the step to hang indefinitely until the runner timeout fires. Add an explicit `process.exit(0)` after the success path in each script. setup-corepack is restructured so `main()` returns the `$`corepack …`` promise and the success log moves into `.then()` before the exit, keeping ordering deterministic. Co-authored-by: Agent (authentik-m-split-pr-committed-every-mikado) <279763771+playpen-agent@users.noreply.github.com> --- scripts/node/lint-lockfile.mjs | 2 ++ scripts/node/lint-runtime.mjs | 1 + scripts/node/setup-corepack.mjs | 11 +++++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/node/lint-lockfile.mjs b/scripts/node/lint-lockfile.mjs index 1b48f86e12..4e8046f029 100755 --- a/scripts/node/lint-lockfile.mjs +++ b/scripts/node/lint-lockfile.mjs @@ -274,5 +274,7 @@ run() } else { logger.info("✅ Lockfile is in sync."); } + + process.exit(0); }) .catch((error) => reportAndExit(error, logger)); diff --git a/scripts/node/lint-runtime.mjs b/scripts/node/lint-runtime.mjs index 718194dd04..05f3ce3a1b 100755 --- a/scripts/node/lint-runtime.mjs +++ b/scripts/node/lint-runtime.mjs @@ -110,5 +110,6 @@ async function main() { main() .then(() => { logger.info("✅ Node.js and npm versions are in sync."); + process.exit(0); }) .catch((error) => reportAndExit(error, logger)); diff --git a/scripts/node/setup-corepack.mjs b/scripts/node/setup-corepack.mjs index 64da33852a..5dd828ebd0 100755 --- a/scripts/node/setup-corepack.mjs +++ b/scripts/node/setup-corepack.mjs @@ -102,9 +102,12 @@ async function main() { subcommand = "use"; } - await $`corepack ${subcommand} ${packageManager}`({ cwd }); - - logger.info("Corepack installed npm successfully"); + return $`corepack ${subcommand} ${packageManager}`({ cwd }); } -main().catch((error) => reportAndExit(error, logger)); +main() + .then(() => { + logger.info("Corepack setup completed successfully"); + process.exit(0); + }) + .catch((error) => reportAndExit(error, logger));