Skip to content

perf(ci): prioritize slow embedded batches and speed up race test filters - #33644

Merged
mergify[bot] merged 1 commit into
matrixorigin:mainfrom
zuyu:codex/race-ut-batch-order
Dec 2, 2026
Merged

mergify[bot] merged 1 commit into
matrixorigin:mainfrom
zuyu:codex/race-ut-batch-order

Conversation

@zuyu

@zuyu zuyu commented Dec 2, 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 #29562.

What this PR does / why we need it:

The race unit-test job took 73–75 minutes in five recent PR runs. With eight embedded-test batches sharing four workers, a batch containing several minute-long tests could start after shorter batches and leave workers idle at the end.

Schedule batches containing six historically slow test roots first in the eight-batch, four-worker pkg/embed profile. The runner finds each root in the current inventory, keeps each batch intact, and preserves the relative order within each priority group. All 179 embedded test roots retain their original batch. For the planner and other sharded tests, sort the alternatives within each shard's regular expression so Go can factor common prefixes.

Timing evidence

  • Replaying the eight batch durations from four hosted runs on four workers projects a reduction of 97–122 seconds in the embedded-test stage. The replay holds each batch's duration fixed. Hosted end-to-end savings still need measurement. Run 1 · Run 2 · Run 3 · Run 4
  • A local race-enabled Go test binary exercised 5,277 planner root names and 25,808 root and subtest entries with empty bodies. Across two runs per version, elapsed time per shard fell from 7.7–8.0 seconds to 2.4–2.5 seconds. Both versions selected identical roots.

Validation

  • All 91 focused race-enabled scheduler and report tests and subtests passed using GNU tools. They exercise dispatch order, shard membership, cancellation, and failure reporting.
  • The partition and dispatch-order tests also passed with Bash 3.2. Package-scoped Go vet and the repository-pinned linter passed.

@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 Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Queue requested — the merge queue status continues in this comment ↓.

@XuPeng-SH

XuPeng-SH commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 57503bfa94154f5276e193234279d04408485f29

Review completed. Read the assessment.

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

mo-bot review · mo-bot-local · review

Commit: 57503bfa94154f5276e193234279d04408485f29

Assessment: approve

No actionable defects found. The change keeps shard membership in the existing partitioner and reorders the existing embedded batch pool without adding scheduler state. Hosted end-to-end savings remain a projection.

Model: gpt-6.1-terra / max

Session: 01a23504-137d-7f93-9b91-fd29f7f60fa2 · slot 1 · generation 42

Validation:

  • Private /tmp and loopback preflight passed; receipt checks/1796189416505332718-3.json and preflight.log.

  • Race-enabled tests using copied, verified runner inputs and the repository’s selected test bodies passed for inventory partitioning, dispatch order, and invalid inventories; receipt checks/1796189601423341852-3.json and review-probe-tests.log.

  • The existing cancellation control and a probe gated at the new per-shard sort passed; receipt checks/1796189650909725081-3.json and cancellation-probe.log.

  • A race-enabled local probe preserved two-shard membership for 5,298 source-derived planner roots. Its fixed-iteration matcher comparison measured 10.60–15.02 seconds for baseline filters and 4.45–6.99 seconds for candidate filters; receipt checks/1796189948390302475-3.json and selector-probe.log.

  • Bash syntax checks passed; receipt checks/1796189972088647828-3.json and bash-syntax.log. The frozen evidence snapshot records a successful Ubuntu UT job, without its detailed log.

  • review-plan.md and discussion-assessment.json were written and verified; the ledger accounts for all three discussion keys.

Limitations:

  • The original owning-package test could not run locally: the checkout requires Go 1.27.1, the installed compiler is Go 1.26.6, and automatic toolchain download timed out. The copied-source checks used Go 1.26.6; the failed setup and timeout are recorded in checks/1796189439982275592-3.json and checks/1796189511140043601-3.json.

  • The planner corpus includes source files without applying build tags, and the local matcher probe does not measure hosted CI wall time.

@mergify mergify Bot added the queued label Dec 2, 2026
@mergify

mergify Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into main as 5b42e69 at 05:42 UTC

Less than a minute in the queue, with no time running CI.

So far

  • ✅ Entered the queue Wed 2 Dec, 05:41 · rule main · triggered by rule Automatic queue on approval for main
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged 05:42 · 5b42e69 · squash
3 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required

Times in UTC · dashboard · how the merge queue works

@mergify
mergify Bot merged commit 5b42e69 into matrixorigin:main Dec 2, 2026
39 checks passed
@mergify mergify Bot removed the queued label Dec 2, 2026
@zuyu
zuyu deleted the codex/race-ut-batch-order branch December 2, 2026 05:44
XuPeng-SH added a commit that referenced this pull request Dec 3, 2026
…33653)

## What type of PR is this?

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

## Which issue(s) this PR fixes:

Related to #29562. Follows #33644.

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

The required check for #33644 finished in 80m45s. Race UT finished last.
In the ordinary embedded phase, the upgrade package took 7m05s of an
8m05s phase. The heavy/plan phase took 8m12s and ended with TAE database
tests running alone. Start upgrade first in the parallel embedded pool
and place the TAE tests first in the heavy package list. Both changes
use the existing workers and test inventory. [Baseline race
job](https://github.com/matrixorigin/matrixone/actions/runs/46807155047/job/143208189086)

The same run spent about 45 minutes on whole-repository Go analysis for
edits to the race runner and its tests. Route modifications to four
named runner scripts and changes to top-level optools Go tests through
the existing package selector. Other files in the diff still contribute
their usual scope. Unknown scripts, changes to the selector, and
unverified inventories retain full analysis. [Baseline static
analysis](https://github.com/matrixorigin/matrixone/actions/runs/46807155047/job/143208188956)

Replaying #33644's three changed paths against the current 505-package
graph selects `./optools`. Both pinned analyzers passed on that
selection. The focused race scheduler suite passed 127 tests and
subtests, and the two Node CI suites passed all 37 tests. This PR edits
the selector itself, so its own hosted run exercises full static
analysis.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: XuPeng-SH <[email protected]>

This branch was previously deployed

1 inactive deployment
ci — 57503bfa Deployed Dec 2, 2026 by zuyu via Matrixone Coverage execution / Coverage #67396
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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