Skip to content

chore: remove rate-limit retry warnings from test stderr#6907

Open
danskmt wants to merge 1 commit into
mainfrom
chore/CLI-1587-ratelimit-warning-failing-tests
Open

chore: remove rate-limit retry warnings from test stderr#6907
danskmt wants to merge 1 commit into
mainfrom
chore/CLI-1587-ratelimit-warning-failing-tests

Conversation

@danskmt

@danskmt danskmt commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Pull Request Submission Checklist

  • Follows CONTRIBUTING guidelines
  • Commit messages are release-note ready, emphasizing what was changed, not how.
  • Includes detailed description of changes
  • Contains risk assessment (Low | Medium | High)
  • Highlights breaking API changes (if applicable)
  • Links to automated tests covering new functionality
  • Includes manual testing instructions (if necessary)
  • Updates relevant GitBook documentation (PR link: ___)
  • Includes product update to be announced in the next stable release notes

What does this PR do?

Stops acceptance tests from failing when CI is briefly rate-limited. CLI-1512 prints a SNYK-0001 retry warning to stderr; if the request succeeds after retry, tests that expect empty stderr still fail.

The shared test runner now removes those transient retry warnings from captured stderr. Only blocks with Automatically retrying in are removed, so real failures after retries are still shown.

Where should the reviewer start?

  • test/jest/util/stripRetryWarnings.ts - stripping logic
  • test/jest/util/runCommand.ts - applies it to captured stderr
  • test/jest/util/stripRetryWarnings.spec.ts - unit tests

How should this be manually tested?

  1. npx jest test/jest/util/stripRetryWarnings.spec.ts
  2. Confirm all 11 tests pass, including 1/3 -> 2/3 -> success and 1/3 -> 2/3 -> fail.

What's the product update that needs to be communicated to CLI users?

None. Test-only change.

@danskmt danskmt requested a review from a team as a code owner June 15, 2026 13:56
@snyk-io

snyk-io Bot commented Jun 15, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@snyk-pr-review-bot

This comment has been minimized.

@danskmt danskmt force-pushed the chore/CLI-1587-ratelimit-warning-failing-tests branch from 1004ea0 to b14bf6b Compare June 16, 2026 09:07
@snyk-pr-review-bot

This comment has been minimized.

@danskmt danskmt force-pushed the chore/CLI-1587-ratelimit-warning-failing-tests branch from b14bf6b to 037fc31 Compare June 16, 2026 09:21
@snyk-pr-review-bot

This comment has been minimized.

@danskmt danskmt force-pushed the chore/CLI-1587-ratelimit-warning-failing-tests branch from 037fc31 to e17f0ce Compare June 16, 2026 13:14
@snyk-pr-review-bot

Copy link
Copy Markdown

PR Reviewer Guide 🔍

🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Brittle Block Parsing 🟡 [minor]

The logic for identifying the end of a warning block relies on finding a DOCS_LINE or the next BLOCK_HEADER. If the CLI output format changes (e.g., the URL structure changes or the 'Docs:' prefix is renamed), the loop will continue until it hits another header or the end of the file. This could lead to over-aggressive stripping if a retry marker is found anywhere in the 'runaway' block, potentially swallowing unrelated error messages that follow a malformed SNYK-0001 block.

for (let j = i; j < lines.length; j++) {
  if (RETRY_MARKER.test(clean[j])) {
    hasRetryMarker = true;
  }
  if (j > i && BLOCK_HEADER.test(clean[j])) {
    end = j - 1;
    break;
  }
  end = j;
  if (DOCS_LINE.test(clean[j])) {
    break;
  }
}
📚 Repository Context Analyzed

This review considered 4 relevant code sections from 2 files (average relevance: 1.00)

🤖 Repository instructions applied (from AGENTS.md)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant