Increase default parallelism for unit and integration test nox sessions #1719

Open
opened 2026-04-02 23:35:27 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: task/m9-increase-test-parallelism
  • Commit Message: chore(nox): increase default parallelism for unit and integration test sessions
  • Milestone: v3.8.0
  • Parent Epic: #1678

Background and Context

The default parallelism for the unit_tests and integration_tests nox sessions is conservatively set to min(cpus, 2). This is a safe default, but it is a significant bottleneck on CI runners with more than 2 cores. The CI Execution Time Optimization Epic (#1678) identifies reducing wall-clock time as a key goal; increasing test parallelism is a direct lever for achieving that.

Expected Behavior

The _default_processes function in noxfile.py should use a higher ceiling — such as min(cpus, 4) or min(cpus, 8) — so that test sessions automatically exploit available cores on multi-core CI runners without requiring manual overrides.

Acceptance Criteria

  • The _default_processes function returns a value up to min(cpus, 4) (or a higher agreed ceiling) rather than min(cpus, 2).
  • The unit_tests and integration_tests nox sessions inherit the updated default without any other changes to their configuration.
  • CI execution time for these sessions is measurably reduced on runners with > 2 cores.
  • The CI pipeline remains stable: no new test flakiness or resource-contention failures are introduced.

Supporting Information

  • Parent Epic: #1678 — CI Execution Time Optimization — Timeouts, Concurrency, and Coverage Artifact Sharing
  • Relevant file: noxfile.py, _default_processes function

Subtasks

  • Identify the current _default_processes implementation in noxfile.py and confirm the existing ceiling value
  • Update _default_processes to use min(cpus, 4) (or the agreed ceiling after review)
  • Update features/ci_workflow_validation.feature (or relevant Behave feature) to assert the new parallelism default if it is tested at the BDD level
  • Run nox -s unit_tests and nox -s integration_tests locally to confirm no flakiness with the new default
  • Monitor CI run durations after the change to confirm wall-clock improvement
  • Verify coverage ≥ 97% via nox -s coverage_report
  • Run nox (all default sessions) and fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%.

Automated by CleverAgents Bot
Supervisor: Test Infrastructure | Agent: ca-new-issue-creator

## Metadata - **Branch**: `task/m9-increase-test-parallelism` - **Commit Message**: `chore(nox): increase default parallelism for unit and integration test sessions` - **Milestone**: v3.8.0 - **Parent Epic**: #1678 ## Background and Context The default parallelism for the `unit_tests` and `integration_tests` nox sessions is conservatively set to `min(cpus, 2)`. This is a safe default, but it is a significant bottleneck on CI runners with more than 2 cores. The CI Execution Time Optimization Epic (#1678) identifies reducing wall-clock time as a key goal; increasing test parallelism is a direct lever for achieving that. ## Expected Behavior The `_default_processes` function in `noxfile.py` should use a higher ceiling — such as `min(cpus, 4)` or `min(cpus, 8)` — so that test sessions automatically exploit available cores on multi-core CI runners without requiring manual overrides. ## Acceptance Criteria - The `_default_processes` function returns a value up to `min(cpus, 4)` (or a higher agreed ceiling) rather than `min(cpus, 2)`. - The `unit_tests` and `integration_tests` nox sessions inherit the updated default without any other changes to their configuration. - CI execution time for these sessions is measurably reduced on runners with > 2 cores. - The CI pipeline remains stable: no new test flakiness or resource-contention failures are introduced. ## Supporting Information - Parent Epic: #1678 — CI Execution Time Optimization — Timeouts, Concurrency, and Coverage Artifact Sharing - Relevant file: `noxfile.py`, `_default_processes` function ## Subtasks - [ ] Identify the current `_default_processes` implementation in `noxfile.py` and confirm the existing ceiling value - [ ] Update `_default_processes` to use `min(cpus, 4)` (or the agreed ceiling after review) - [ ] Update `features/ci_workflow_validation.feature` (or relevant Behave feature) to assert the new parallelism default if it is tested at the BDD level - [ ] Run `nox -s unit_tests` and `nox -s integration_tests` locally to confirm no flakiness with the new default - [ ] Monitor CI run durations after the change to confirm wall-clock improvement - [ ] Verify coverage ≥ 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions) and fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage >= 97%. --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: ca-new-issue-creator
freemo added this to the v3.8.0 milestone 2026-04-02 23:35:54 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • MoSCoW: MoSCoW/Could Have — CI/test infrastructure improvement. Could Have.

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **MoSCoW**: MoSCoW/Could Have — CI/test infrastructure improvement. Could Have. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#1719
No description provided.