TEST-INFRA: [ci-execution-time] Investigate and optimize the unit_tests session #1819

Open
opened 2026-04-02 23:55:34 +00:00 by freemo · 2 comments
Owner

Metadata

  • Branch: test-infra/ci-execution-time/optimize-unit-tests-session
  • Commit Message: perf(ci): investigate and optimize unit_tests nox session execution time
  • Milestone: v3.8.0
  • Parent Epic: #1678

Description

The unit_tests nox session is taking a long time to run and is timing out in CI. This is slowing down the development workflow and making it difficult to get fast feedback on changes.

Task:

  • Investigate the cause of the slow execution time of the unit_tests session.
  • Identify the slowest test suites and tests.
  • Propose and implement optimizations to reduce the execution time of the unit_tests session.

Acceptance Criteria:

  • The execution time of the unit_tests session is significantly reduced.
  • The optimizations do not compromise the quality of the tests.

Subtasks

  • Profile the nox -e unit_tests session to identify the slowest Behave feature files and step definitions
  • Analyse whether parallelism settings (e.g. behave-parallel worker count) are tuned for CI runner capacity
  • Identify any unnecessary I/O, database setup/teardown, or fixture overhead in the slowest scenarios
  • Investigate whether any scenarios can be refactored to reduce setup cost (e.g. shared context, lighter mocks)
  • Implement the agreed optimizations (parallelism tuning, fixture refactoring, etc.)
  • Verify that all optimizations preserve test correctness and coverage ≥ 97%
  • Document the findings and the changes made in the PR description

Definition of Done

  • Root cause(s) of the slow unit_tests execution time are identified and documented
  • At least one measurable optimization is implemented and merged
  • nox -e unit_tests completes within an acceptable time budget in CI (no timeouts)
  • nox -e coverage_report still passes with coverage ≥ 97%
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `test-infra/ci-execution-time/optimize-unit-tests-session` - **Commit Message**: `perf(ci): investigate and optimize unit_tests nox session execution time` - **Milestone**: v3.8.0 - **Parent Epic**: #1678 ## Description The `unit_tests` nox session is taking a long time to run and is timing out in CI. This is slowing down the development workflow and making it difficult to get fast feedback on changes. **Task:** - Investigate the cause of the slow execution time of the `unit_tests` session. - Identify the slowest test suites and tests. - Propose and implement optimizations to reduce the execution time of the `unit_tests` session. **Acceptance Criteria:** - The execution time of the `unit_tests` session is significantly reduced. - The optimizations do not compromise the quality of the tests. ## Subtasks - [ ] Profile the `nox -e unit_tests` session to identify the slowest Behave feature files and step definitions - [ ] Analyse whether parallelism settings (e.g. `behave-parallel` worker count) are tuned for CI runner capacity - [ ] Identify any unnecessary I/O, database setup/teardown, or fixture overhead in the slowest scenarios - [ ] Investigate whether any scenarios can be refactored to reduce setup cost (e.g. shared context, lighter mocks) - [ ] Implement the agreed optimizations (parallelism tuning, fixture refactoring, etc.) - [ ] Verify that all optimizations preserve test correctness and coverage ≥ 97% - [ ] Document the findings and the changes made in the PR description ## Definition of Done - [ ] Root cause(s) of the slow `unit_tests` execution time are identified and documented - [ ] At least one measurable optimization is implemented and merged - [ ] `nox -e unit_tests` completes within an acceptable time budget in CI (no timeouts) - [ ] `nox -e coverage_report` still passes with coverage ≥ 97% - [ ] 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:55:44 +00:00
Author
Owner

Issue triaged by project owner:

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

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. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Author
Owner

Issue triaged by project owner:

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

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. --- **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#1819
No description provided.