Skip to content

fix(test): Fix hanging application after test#6753

Merged
PeterSchafer merged 1 commit intomainfrom
fix/CLI-1166
Apr 29, 2026
Merged

fix(test): Fix hanging application after test#6753
PeterSchafer merged 1 commit intomainfrom
fix/CLI-1166

Conversation

@PeterSchafer
Copy link
Copy Markdown
Contributor

@PeterSchafer PeterSchafer commented Apr 29, 2026

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?

This PR adds an explicit process.exit to the Typescript CLI to prevent it from hanging when resources are left open. This is more of a workaround then a fix of a bug in a dependency.

Where should the reviewer start?

How should this be manually tested?

snyk test xlsx

Risk assessment (Low | Medium | High)?

Low

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

Fix edge cases where the CLI would failt to exit properly and just hang.

@PeterSchafer PeterSchafer requested review from a team as code owners April 29, 2026 09:25
@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented Apr 29, 2026

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.

@PeterSchafer PeterSchafer changed the title fix(test): fix(test): Fix hanging application after test Apr 29, 2026
@PeterSchafer PeterSchafer enabled auto-merge April 29, 2026 09:30
@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@PeterSchafer PeterSchafer disabled auto-merge April 29, 2026 09:45
@snyk-pr-review-bot
Copy link
Copy Markdown

PR Reviewer Guide 🔍

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

Redundant Test Execution 🟡 [minor]

The test case run snyk test xlsx is placed inside a describe.each(userJourneyWorkflows) block. Unlike the surrounding tests (e.g., line 832), this new test does not utilize the project or env variables provided by the loop; it simply runs a global command. Consequently, this test will execute once for every workflow in the array (e.g., Go, Python, Maven), which is redundant and increases CI duration without adding coverage. It should be moved outside the describe.each block.

test('run `snyk test xlsx` on npm package with redirect', async () => {
  const { code } = await runSnykCLI('test xlsx');

  expect([0, 1]).toContain(code);
});
Missing Error Handler 🟡 [minor]

In the needle patch, resp.resume() is called to discard the redirect response body. In Node.js, switching a stream to flowing mode with resume() can lead to an unhandled 'error' event if the stream encounters a network failure before completion. If the needle library has already removed its primary listeners for this response instance during the redirect transition, this could cause the CLI process to crash. A safer approach is to attach a no-op error listener: resp.on('error', () => {}).resume();.

+        resp.resume();
📚 Repository Context Analyzed

This review considered 6 relevant code sections from 4 files (average relevance: 0.97)

@PeterSchafer PeterSchafer enabled auto-merge April 29, 2026 11:20
@PeterSchafer PeterSchafer merged commit 070c079 into main Apr 29, 2026
9 checks passed
@PeterSchafer PeterSchafer deleted the fix/CLI-1166 branch April 29, 2026 12:49
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.

2 participants