Skip to content

ci: shard race UT suite - #28575

Merged
XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
gouhongshen:agent/issue-28538-6b70d256
Sep 10, 2026
Merged

XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
gouhongshen:agent/issue-28538-6b70d256

Conversation

@gouhongshen

@gouhongshen gouhongshen commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Related to #28538

What this PR does / why we need it:

Root cause

The MatrixOne workflow called the reusable CI workflow without its existing ut_sharded input. The reusable workflow therefore executed UT_SHARD=all: light, issues, embedded, heavy, and plan stages shared one 70-minute outer deadline. Three observed runs exhausted that aggregate deadline in different stages without a terminal test failure or race report.

Changes

Enable the reusable workflow four-way race-UT contract. It runs the complete, disjoint light, issues, embedded, and heavy-plan stage groups in separate jobs and retains the existing aggregate required check. Add a workflow-contract unit test that locks the caller input; refactor the existing job parser so both workflow tests share it.

Issue-to-test proof

entrypoint enables the complete race-UT shard contract proves the caller supplies ut_sharded: true with the established per-runner parallelism. TestUTShardStagesFormCompleteDisjointMap proves those target groups are a complete, non-overlapping partition; its negative companion rejects unknown routing values.

Tests

Rebased onto 269d59addd032d20897cc4d86f58de3e387a6d76 and reran:

  • node --test .github/ci/change-scope.test.cjs
  • GOWORK=off go test -mod=readonly -v -count=1 -timeout=120s ./optools
  • go run github.com/rhysd/actionlint/cmd/actionlint@latest .github/workflows/entrypoint.yaml
  • Ruby YAML parse and git diff --check\n- MatrixOne ALL CI run 34446145941 completed successfully, including CI Required and the Ubuntu/x86 race-UT check; as documented below, pull_request_target ran the trusted base caller, not this changed caller input.

Residual risk

The change uses four runners rather than one, as designed by the reusable workflow. This repository uses pull_request_target, so the CI run for this Draft PR evaluates the trusted base caller and cannot exercise the changed ut_sharded input. Target-runner confirmation therefore requires the first post-merge CI run or a CI-owner-dispatched sharded run; the change preserves per-test and timeout diagnostics instead of masking failures.

@XuPeng-SH XuPeng-SH 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.

Reviewed live head 8b0040f against base/merge-base 2a6fe7f, including the live reusable CI consumer at matrixorigin/CI commit 2ab1af3a85ca3c4e4eab7483201aca3e1913dd99.

No concrete blocker found. This is a bounded activation of the existing sharding contract, not a new sharding/lifecycle design. The caller passes the declared boolean input and retains ut_parallel=6. The four shards cover light+HNSW, exclusive issues, embedded, and heavy+plan exactly once; run_ut.sh validates both the stage partition and the complete package partition before testing. It retains race-instrumented execution, existing test selection/exclusions and per-package timeout behavior, and fails closed for invalid routing or discovery. UT-only versus full-suite classification and the independent coverage workflow are unchanged.

The reusable workflow checks out the event's immutable head SHA, bounds fan-out to four jobs, disables matrix fail-fast, and preserves 'UT Test on Ubuntu/x86' on an always-run summary which requires the matrix result to be success. Test/build/report-transfer failures remain nonzero; diagnostic printing cannot turn a failed test step green. Existing process-group termination and bounded TERM/KILL cleanup remain in place. Issues retain their exclusive runner, embedded cluster lifecycle admission stays in its shard, and heavy/engine process budgets remain unchanged. Splitting runners does not introduce shared in-process state or increase per-runner package concurrency.

Validation performed read-only against git-object contents: all eight change-scope Node tests passed, including the new caller contract and required-check negative controls; the exact-head shell stage partition and unknown-shard rejection passed; git diff --check passed. Author's optools and actionlint evidence was inspected; I did not run the full race suite or wait for CI.

Operational follow-up: four runner jobs duplicate build/discovery overhead and can increase total runner minutes or queue pressure even while reducing the critical path. Actual target-runner wall time/peak memory and successful aggregate-check publication still need the documented first trusted-caller run or CI-owner dispatch, because pull_request_target does not exercise this PR's changed caller before merge. This limitation is explicit, not evidence of a missing test target or a reason to attribute the earlier timeout to a particular test.

@gouhongshen
gouhongshen force-pushed the agent/issue-28538-6b70d256 branch from 8b0040f to 6381f13 Compare September 10, 2026 04:17
@gouhongshen
gouhongshen force-pushed the agent/issue-28538-6b70d256 branch from 6381f13 to 6806093 Compare September 10, 2026 04:46
@gouhongshen
gouhongshen force-pushed the agent/issue-28538-6b70d256 branch from 6806093 to 12ec9bf Compare September 10, 2026 06:12
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@mergify

mergify Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-10 07:48 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-09-10 07:58 UTC · at 579fce2aff430a28d0328f40a76bc938ed10b94b

This pull request spent 9 minutes 57 seconds in the queue, with no time running CI.

Reason

The pull request can't be updated

This pull request seems to come from a fork, and Mergify needs the author's permission to update its branch.
The author needs to enable "Allow edits from maintainers" on this pull request, or update the branch manually.

Hint

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

@XuPeng-SH
XuPeng-SH merged commit e5ea5f2 into matrixorigin:main Sep 10, 2026
20 of 22 checks passed
@mergify mergify Bot added dequeued and removed queued labels Sep 10, 2026
XuPeng-SH added a commit that referenced this pull request Sep 10, 2026
## What type of PR is this?

- [x] Improvement
- [x] Test and CI

## Which issue(s) this PR fixes:

Related to #28419 and #28538.

## What this PR does / why we need it:

Keep the complete race-UT suite on one runner and reuse engine capacity
to run plan tests while the remaining resource-heavy tests finish. A
historical single-runner trace left engine slots idle from 06:22:22 to
06:26:04, then ran plan for about another 2m20s.

With the default budget of three, execution changes from `engine(2) +
resource(1)` to `plan(1) + resource(1)` after engine exits. Plan
compilation retains `-p1`. `UT_OVERLAP_PLAN=1` enables this by default;
`0` provides the sequential baseline. Budgets of one/two and paths
without a concurrent engine helper keep sequential execution. The CI
caller restores `ut_sharded: false`, undoing #28575's multi-runner
topology; that restoration itself is not counted as a speedup against
the previous single-runner baseline.

The parent keeps the foreground PID and independent command metadata
while joining engine. Engine failure remains a failure and does not skip
plan. Report merging waits for the heavy writer to exit, avoiding data
loss from renaming an open output file. Cancellation signals all owned
groups before bounded waits and merges stopped writers only.

No test cases, data sizes, assertions, race flags, timeouts, cluster
admission, or coverage jobs are weakened. The logservice companion
experiment was removed: package elapsed time alone did not demonstrate
critical-path savings.

### Validation

- `go test -race ./optools -count=1`
- Both new scheduling/cancellation tests passed individually with `-race
-count=3`; scheduling covers defaults, overlap, each stage failing,
sequential mode, and budgets 1/2.
- `go vet ./optools`
- `node --test .github/ci/change-scope.test.cjs`
- `bash -n optools/run_ut.sh` and `git diff --check`
- Independent GPT-6 medium review: no blocking or medium findings.
- Real heavy/plan runs passed with the repository CGo wrapper, `-race`,
`matrixone_test`, and the unchanged three-slot budget. The warm
sequential baseline took 303.11s; overlap took 229.19s: 73.92s (24.4%)
less elapsed time for this local stage sample. Both runs had exactly the
same 16,013 test/subtest start events and terminal statuses, with zero
failures.
- A first cold baseline took 440.04s and is excluded from the claimed
gain. Measurement order was cold sequential, warm overlap, then warm
sequential. This is one local macOS comparison, not a controlled Linux
CI benchmark. The heavy/plan scheduler was invoked directly, with
existing native artifacts verified by the official wrapper; checkout,
native prerequisite rebuild, and full-suite setup were excluded equally
from both measurements. External-service eligibility remains
environment-dependent.
- The historical CI trace suggests roughly 2m20s of potential overlap;
this is not a measured CI saving. Target Linux CI still needs to confirm
peak memory and net elapsed time.

This repository uses `pull_request_target`, so this PR still uses the
base workflow's four-job caller until merged. Its heavy-plan job does
execute the updated scheduler from the PR head; the single-runner caller
is covered by the workflow contract test.
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Related to matrixorigin#28538

## What this PR does / why we need it:

### Root cause

The MatrixOne workflow called the reusable CI workflow without its
existing `ut_sharded` input. The reusable workflow therefore executed
`UT_SHARD=all`: light, issues, embedded, heavy, and plan stages shared
one 70-minute outer deadline. Three observed runs exhausted that
aggregate deadline in different stages without a terminal test failure
or race report.

### Changes

Enable the reusable workflow four-way race-UT contract. It runs the
complete, disjoint `light`, `issues`, `embedded`, and `heavy-plan` stage
groups in separate jobs and retains the existing aggregate required
check. Add a workflow-contract unit test that locks the caller input;
refactor the existing job parser so both workflow tests share it.

### Issue-to-test proof

`entrypoint enables the complete race-UT shard contract` proves the
caller supplies `ut_sharded: true` with the established per-runner
parallelism. `TestUTShardStagesFormCompleteDisjointMap` proves those
target groups are a complete, non-overlapping partition; its negative
companion rejects unknown routing values.

### Tests

Rebased onto `269d59addd032d20897cc4d86f58de3e387a6d76` and reran:

- `node --test .github/ci/change-scope.test.cjs`
- `GOWORK=off go test -mod=readonly -v -count=1 -timeout=120s ./optools`
- `go run github.com/rhysd/actionlint/cmd/actionlint@latest
.github/workflows/entrypoint.yaml`
- Ruby YAML parse and `git diff --check`\n- MatrixOne ALL CI run
34446145941 completed successfully, including `CI Required` and the
Ubuntu/x86 race-UT check; as documented below, `pull_request_target` ran
the trusted base caller, not this changed caller input.

### Residual risk

The change uses four runners rather than one, as designed by the
reusable workflow. This repository uses `pull_request_target`, so the CI
run for this Draft PR evaluates the trusted base caller and cannot
exercise the changed `ut_sharded` input. Target-runner confirmation
therefore requires the first post-merge CI run or a CI-owner-dispatched
sharded run; the change preserves per-test and timeout diagnostics
instead of masking failures.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…8632)

## What type of PR is this?

- [x] Improvement
- [x] Test and CI

## Which issue(s) this PR fixes:

Related to matrixorigin#28419 and matrixorigin#28538.

## What this PR does / why we need it:

Keep the complete race-UT suite on one runner and reuse engine capacity
to run plan tests while the remaining resource-heavy tests finish. A
historical single-runner trace left engine slots idle from 06:22:22 to
06:26:04, then ran plan for about another 2m20s.

With the default budget of three, execution changes from `engine(2) +
resource(1)` to `plan(1) + resource(1)` after engine exits. Plan
compilation retains `-p1`. `UT_OVERLAP_PLAN=1` enables this by default;
`0` provides the sequential baseline. Budgets of one/two and paths
without a concurrent engine helper keep sequential execution. The CI
caller restores `ut_sharded: false`, undoing matrixorigin#28575's multi-runner
topology; that restoration itself is not counted as a speedup against
the previous single-runner baseline.

The parent keeps the foreground PID and independent command metadata
while joining engine. Engine failure remains a failure and does not skip
plan. Report merging waits for the heavy writer to exit, avoiding data
loss from renaming an open output file. Cancellation signals all owned
groups before bounded waits and merges stopped writers only.

No test cases, data sizes, assertions, race flags, timeouts, cluster
admission, or coverage jobs are weakened. The logservice companion
experiment was removed: package elapsed time alone did not demonstrate
critical-path savings.

### Validation

- `go test -race ./optools -count=1`
- Both new scheduling/cancellation tests passed individually with `-race
-count=3`; scheduling covers defaults, overlap, each stage failing,
sequential mode, and budgets 1/2.
- `go vet ./optools`
- `node --test .github/ci/change-scope.test.cjs`
- `bash -n optools/run_ut.sh` and `git diff --check`
- Independent GPT-6 medium review: no blocking or medium findings.
- Real heavy/plan runs passed with the repository CGo wrapper, `-race`,
`matrixone_test`, and the unchanged three-slot budget. The warm
sequential baseline took 303.11s; overlap took 229.19s: 73.92s (24.4%)
less elapsed time for this local stage sample. Both runs had exactly the
same 16,013 test/subtest start events and terminal statuses, with zero
failures.
- A first cold baseline took 440.04s and is excluded from the claimed
gain. Measurement order was cold sequential, warm overlap, then warm
sequential. This is one local macOS comparison, not a controlled Linux
CI benchmark. The heavy/plan scheduler was invoked directly, with
existing native artifacts verified by the official wrapper; checkout,
native prerequisite rebuild, and full-suite setup were excluded equally
from both measurements. External-service eligibility remains
environment-dependent.
- The historical CI trace suggests roughly 2m20s of potential overlap;
this is not a measured CI saving. Target Linux CI still needs to confirm
peak memory and net elapsed time.

This repository uses `pull_request_target`, so this PR still uses the
base workflow's four-job caller until merged. Its heavy-plan job does
execute the updated scheduler from the PR head; the single-runner caller
is covered by the workflow contract test.

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/test-ci size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants