From d40e417f3c43e66dec164393f3b2b94722865c6f Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 1 Jun 2026 16:43:42 +0100 Subject: [PATCH] Only do initial wait when not running tests --- lib/entry-points.js | 4 +++- src/upload-lib.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/entry-points.js b/lib/entry-points.js index 3ee58bebb..1a19e2a49 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -157483,7 +157483,9 @@ async function waitForProcessing(repositoryNwo, sarifID, logger, options = { try { const client = getApiClient(); let statusCheckBackoff = STATUS_CHECK_INITIAL_BACKOFF_MILLISECONDS; - await delay(statusCheckBackoff, { allowProcessExit: false }); + if (process.env["NODE_ENV"] !== "test") { + await delay(statusCheckBackoff, { allowProcessExit: false }); + } for (let statusCheckCount = 1; statusCheckCount <= STATUS_CHECK_MAX_TRIES; statusCheckCount++) { let response = void 0; try { diff --git a/src/upload-lib.ts b/src/upload-lib.ts index 005227ea7..83d1eaffb 100644 --- a/src/upload-lib.ts +++ b/src/upload-lib.ts @@ -858,7 +858,9 @@ export async function waitForProcessing( // Do an initial wait because processing will always take a minimum of 2-3 seconds let statusCheckBackoff = STATUS_CHECK_INITIAL_BACKOFF_MILLISECONDS; - await util.delay(statusCheckBackoff, { allowProcessExit: false }); + if (process.env["NODE_ENV"] !== "test") { + await util.delay(statusCheckBackoff, { allowProcessExit: false }); + } for ( let statusCheckCount = 1;