Skip to content

ci: run unit and end-to-end tests in parallel - #1965

Merged
hidb4ai merged 2 commits into
oceanbase:masterfrom
Fengzdadi:ci/parallel-tests
Oct 13, 2026
Merged

hidb4ai merged 2 commits into
oceanbase:masterfrom
Fengzdadi:ci/parallel-tests

Conversation

@Fengzdadi

Copy link
Copy Markdown
Contributor

Which issue or RFC does this PR close?

No linked issue. This PR addresses Main CI duration, which has grown steadily over the last two months.

Rationale for this change

The tests (3.x) jobs in the Main workflow are the critical path of every PR. Each one runs make unit-test and then make e2e-test in a single pytest process. Sampled tests (3.14) step durations on master pushes (minutes, unit / e2e):

Date Unit E2E
2026-08-20 0 0
2026-09-13 6 3
2026-09-30 8 5
2026-10-12 12 11

The suite now collects about 5,500 tests (837 under tests/e2e). A local --durations=40 profile shows no single hotspot: the slowest 40 tests total about 125 s of a 643 s serial run, and the slowest single test takes 12 s. Fixing individual tests would recover little, so this PR changes how the suite runs instead.

What changes are included in this PR?

  • Add pytest-xdist to the dev dependency group.
  • make test, make unit-test, and make e2e-test pass -n $(PYTEST_WORKERS), defaulting to auto (one worker per CPU). PYTEST_WORKERS=0 runs a single process, for example when debugging with pdb.
  • The Main tests matrix gains a suite: [unit, e2e] axis, so the two suites run as separate parallel jobs. The DSH configuration runtime setup runs only in the unit jobs, which are the only ones that pass --require-dsh-config-runtime.
  • CONTRIBUTING.md documents the parallel default and the opt-out.

Job names change from tests (3.14) to tests (3.14, unit) and tests (3.14, e2e). The master ruleset has no required status checks, so the rename does not block merging.

The E2E harness workflow invokes pytest directly and is unchanged.

Are there any user-facing changes?

No product changes. Contributors running the make test targets get parallel execution by default.

How was this change tested?

Locally on macOS (18 CPUs), Python 3.13:

Command Result Time
pytest --doctest-modules (serial, before) 5046 passed, 424 skipped 10:42
unit, -n 4 4529 passed, 196 skipped 3:18
e2e, -n 4 613 passed, 231 skipped 1:19
make unit-test (-n auto) 4529 passed, 196 skipped 1:43
make e2e-test (-n auto) 613 passed, 231 skipped 1:07

make check passes, and -n 0 runs a single process.

Not validated locally: tests skipped here because the DSH configuration runtime and other CI-only prerequisites were absent. This PR's own CI run is the first parallel run of those tests on the 4-CPU Linux runners.

AI usage statement

Claude Code (Claude Opus 5.5) was used to profile the CI and test durations, implement the change, and draft this description. I reviewed the changes and the results.

The Main tests job ran the unit and end-to-end suites one after the other
in a single pytest process, so the job grew from under a minute in August
to about 25 minutes as the suite reached about 5,500 tests. No single test
dominates: the slowest 40 account for under a fifth of the serial run.

The make test targets now spread tests across one pytest-xdist worker per
CPU, with PYTEST_WORKERS=0 restoring a single process, and the Main matrix
runs the unit and end-to-end suites as separate jobs.
Copilot AI balanced review requested due to automatic review settings October 12, 2026 19:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The Bub harness lock records the root project's dev group, so the new
pytest-xdist requirement left it stale and harness-sync rejected it.
Copilot AI balanced review requested due to automatic review settings October 12, 2026 19:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Fengzdadi

Copy link
Copy Markdown
Contributor Author

The controlled-cli failure in ZCode acceptance is unrelated to this PR. It also fails on current master.

The job stops at python -m evaluation.zcode_guidance.pin --check with ValueError: skill_pin_mismatch. #1850 pinned the hashes of integrations/zcode/plugins/powercontext/skills/powercontext-project-context in evaluation/zcode_guidance/skill-lock.json. #1877 then changed that Skill without updating the pin. The check fails the same way locally on upstream/master (b5bcfe2), and today's runs of this job on other PRs (e.g. feat/memory-entry-pagination-1656, fix/kimi-code-minimal-integration) fail with the same error.

This PR does not touch the Skill or the pin. Because a changed pin needs a new model run, I've left it to whoever owns the ZCode guidance evaluation.

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hidb4ai
hidb4ai merged commit 7548115 into oceanbase:master Oct 13, 2026
34 of 35 checks passed
@hidb4ai hidb4ai added the 1.4.0 v1.4.0 release tracking label Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.4.0 v1.4.0 release tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants