fix(nested-requests): disable parallel iterations for nested runners #1536
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Change
The commit e2669d3 adds a single line in lib/runner/nested-request.js:133:
customParallelIterations: false
This option is passed when creating a new runner for nested requests (requests invoked via pm.execution.runRequest()).
Background Context
The runtime recently added support for running collection iterations in parallel (commit 455b308). This feature allows multiple iterations to execute concurrently, controlled by options like:
When enabled (areIterationsParallelized = true), the runtime:
When a script calls pm.execution.runRequest(), the runtime creates a new independent runner to execute the referenced request. This nested runner is created at line 114 in nested-request.js.
The Problem
Without this fix, when creating a nested runner, it would inherit all options from the parent runner, including parallel iteration settings. This caused issues:
if (this.options.customParallelIterations) {
this.options.maxConcurrency = 1;
this.options.iterationCount = 1;
}
- Spawn a partition manager
- Create partitions for a single iteration
- Use parallel command processing infrastructure
- Event triggering (abort, iteration lifecycle)
- Variable scope management
- Cursor tracking across nested parallel contexts
The Solution
By explicitly setting customParallelIterations: false, the nested runner: