Skip to content

feat: parallelize container test dependency requests#6747

Closed
bgardiner wants to merge 7 commits intomainfrom
cursor/container-test-parallel-61fd
Closed

feat: parallelize container test dependency requests#6747
bgardiner wants to merge 7 commits intomainfrom
cursor/container-test-parallel-61fd

Conversation

@bgardiner
Copy link
Copy Markdown
Contributor

@bgardiner bgardiner commented Apr 24, 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 updates request dispatch in the active snyk container test path (src/lib/snyk-test/run-test.ts) and keeps request execution parallelized via the existing pMap concurrency limit (MAX_CONCURRENCY = 5).

Important routing correction

A previous iteration targeted src/lib/ecosystems/test.ts, but snyk container test currently routes through the legacy test flow (snyk-test/run-test.ts), not that ecosystems test function. This PR keeps changes in the correct path.

Where should the reviewer start?

  • src/lib/snyk-test/run-test.ts

How should this be manually tested?

  1. Run lint checks (matches CI code-analysis lint stage):
    • npm run lint
  2. Run related monitor unit tests for regression confidence:
    • npm run test:unit -- --runTestsByPath test/jest/unit/ecosystems-monitor-docker.spec.ts
  3. Optionally run a representative container test command against a multi-project image and compare duration:
    • snyk container test <image>

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

Container test request orchestration changes are applied in the active legacy test path used by snyk container test.

Risk assessment (Low | Medium | High)?

Low. The final change is narrowly scoped and maintains existing container request parallelism semantics.

Any background context you want to provide?

The branch previously introduced a base-first ordering strategy for container payloads, but that was intentionally removed.

What are the relevant tickets?

N/A

Open in Web Open in Cursor 

Co-authored-by: bgardiner <bgardiner@users.noreply.github.com>
@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented Apr 24, 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.

Co-authored-by: bgardiner <bgardiner@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

Warnings
⚠️

You've modified files in src/ directory, but haven't updated anything in test folder. Is there something that could be tested?

⚠️ There are multiple commits on your branch, please squash them locally before merging!

Generated by 🚫 dangerJS against 5e8974f

@bgardiner
Copy link
Copy Markdown
Contributor Author

Closing — this PR targets the wrong code path for snyk container test.

The PR modifies src/lib/ecosystems/test.ts:testDependencies, but that function is unreachable from container test:

  • Container test routes through cli/commands/test/index.ts:153, which calls getEcosystemForTest(options) from src/lib/ecosystems/index.ts:16-24.
  • getEcosystemForTest only returns non-null for --unmanaged and --code — it returns null for docker.
  • Container test therefore falls through to the legacy runTest path (src/lib/snyk-test/run-test.ts), which already runs pMap at concurrency 5 in sendAndParseResults (line 298).

The unit test in this PR confirms the rewrite works if selectAndExecuteTestStrategy('docker', ...) is reached, but production code never calls it for docker.

The actual win for container test is to bump the concurrency limit at the existing pMap call site, which #6756 does (SNYK_REQUEST_CONCURRENCY, default 10).

(testDependencies in ecosystems/test.ts is still hit by --code and --unmanaged, so a parallelization there could be useful as a separate, intentional change — but the title and motivation here are about container test specifically.)

@bgardiner
Copy link
Copy Markdown
Contributor Author

Closing — wrong code path. See review comment above. Container test is already parallel; the actual fix is bumping the concurrency limit (#6756).

@bgardiner bgardiner closed this Apr 29, 2026
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