Skip to content

[ci-fix] test: mock secrets binary in analyze-skips-agentic test to prevent Windows hook timeout#432

Draft
github-actions[bot] wants to merge 1 commit into
masterfrom
ci-fix/windows-analyze-hook-timeout-7a6e5645d450acd3
Draft

[ci-fix] test: mock secrets binary in analyze-skips-agentic test to prevent Windows hook timeout#432
github-actions[bot] wants to merge 1 commit into
masterfrom
ci-fix/windows-analyze-hook-timeout-7a6e5645d450acd3

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Diagnosis

Category: Flaky / transient — Windows afterEach hook timeout caused by real binary download

The Integration and E2E Tests - windows job in Build run #27271275740 failed on commit 51b393e (CLI-646 Add --project option to 'sonar analyze') with:

(fail) analyze agentic — change-set mode (no --file) > exits with code 0 and skips agentic gracefully for the bare `analyze` command when no project is configured [7317.74ms]
  ^ a beforeEach/afterEach hook timed out for this test.

Root Cause

The bare analyze command calls analyzeSecrets() on the resolved change set. The test creates an untracked file (app.ts) so the change set is non-empty, triggering installSecretsBinary() which attempts to download the real sonar-secrets binary from binaries.sonarsource.com.

On Windows CI, this download (or the subsequent cleanup of the freshly-written binary file) causes harness.dispose() inside afterEach to exceed Bun's default hook timeout — even though the test body itself completes and its assertions pass.

Fix

Add withSecretsBinaryInstalled() to the test's setup so the pre-built mock binary (from tests/integration/resources/dependency-artifacts/) is used instead of downloading the real one. This matches the pattern already used by all other tests in the same describe block that exercise the bare analyze command.

File changed: tests/integration/specs/analyze/analyze-sqaa.test.ts

Triggering failure

Generated by Ci Failure Triage Agent · sonnet46 7.9M ·

…ndows hook timeout

The 'exits with code 0 and skips agentic gracefully for the bare
analyze command when no project is configured' test was failing on
Windows with 'a beforeEach/afterEach hook timed out'.

The bare analyze command calls analyzeSecrets() on the change set.
Without withSecretsBinaryInstalled(), the CLI tries to download the
real sonar-secrets binary from binaries.sonarsource.com during the
test. On Windows CI, this download (or the subsequent cleanup of the
freshly-written binary file) causes harness.dispose() in afterEach
to exceed Bun's default hook timeout.

Add withSecretsBinaryInstalled() so the pre-built mock binary is used
instead, matching the pattern of other tests in the same describe block
that exercise the bare analyze command.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@netlify

netlify Bot commented Jun 10, 2026

Copy link
Copy Markdown

Deploy Preview for sonarqube-cli canceled.

Name Link
🔨 Latest commit 6ec2655
🔍 Latest deploy log https://app.netlify.com/projects/sonarqube-cli/deploys/6a294832295ae6000820b039

1 similar comment
@netlify

netlify Bot commented Jun 10, 2026

Copy link
Copy Markdown

Deploy Preview for sonarqube-cli canceled.

Name Link
🔨 Latest commit 6ec2655
🔍 Latest deploy log https://app.netlify.com/projects/sonarqube-cli/deploys/6a294832295ae6000820b039

@nquinquenel nquinquenel reopened this Jun 17, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant