From 53ddacf9f6127226ab6d33cbc06e5b68f340398a Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Thu, 12 Mar 2026 11:14:12 -0700 Subject: [PATCH] Fix flaky Vercel prod e2e tests by skipping CLI update check The e2e tests spawn a CLI subprocess for every inspect/cancel/health call. Each subprocess performs an npm registry version check on startup, which can hang under load and exceed the 20s spawn timeout, causing SIGTERM. Add WORKFLOW_NO_UPDATE_CHECK=1 env var support to skip the check, and set it in the e2e test harness. --- .changeset/skip-update-check-env.md | 5 +++++ packages/cli/src/lib/update-check.ts | 7 +++++++ packages/core/e2e/utils.ts | 1 + 3 files changed, 13 insertions(+) create mode 100644 .changeset/skip-update-check-env.md diff --git a/.changeset/skip-update-check-env.md b/.changeset/skip-update-check-env.md new file mode 100644 index 0000000000..0d91887bb4 --- /dev/null +++ b/.changeset/skip-update-check-env.md @@ -0,0 +1,5 @@ +--- +"@workflow/cli": patch +--- + +Support `WORKFLOW_NO_UPDATE_CHECK=1` env var to skip the npm registry version check on startup diff --git a/packages/cli/src/lib/update-check.ts b/packages/cli/src/lib/update-check.ts index 779cec3168..9e86968149 100644 --- a/packages/cli/src/lib/update-check.ts +++ b/packages/cli/src/lib/update-check.ts @@ -246,10 +246,17 @@ async function isCacheValid( /** * Check for updates with filesystem caching * Cache is valid unless the local version changes + * + * Set WORKFLOW_NO_UPDATE_CHECK=1 to skip the update check entirely. */ export async function checkForUpdateCached( currentVersion: string ): Promise { + if (process.env.WORKFLOW_NO_UPDATE_CHECK === '1') { + logger.debug('Skipping update check (WORKFLOW_NO_UPDATE_CHECK=1)'); + return { currentVersion, needsUpdate: false }; + } + const cacheFile = getVersionCheckCacheFile(); // Check if cache is valid diff --git a/packages/core/e2e/utils.ts b/packages/core/e2e/utils.ts index b4f2011fe2..62322f7b2c 100644 --- a/packages/core/e2e/utils.ts +++ b/packages/core/e2e/utils.ts @@ -137,6 +137,7 @@ const awaitCommand = async ( env: { ...process.env, DEBUG: '1', + WORKFLOW_NO_UPDATE_CHECK: '1', ...envOverrides, }, });