Skip to content

test: reduce DML diff fixture work and scheduling tail - #29031

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/28419-ut-cost-20260917
Sep 17, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/28419-ut-cost-20260917

Conversation

@XuPeng-SH

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 #28419. This is a measured case-cost follow-up, not a claim that the whole-suite timeout issue is closed.

What this PR does / why we need it:

TestDataBranchDiffAsFile holds the shared embedded cluster while running 20 scenarios. It previously launched every scenario as a goroutine before acquiring one of two execution slots, so the longest scenario could start near the end and leave a long single-worker tail. In CI run 35170421812, the parent took 70.24s and its 28.15s special-column scenario started about 32s after the parent.

Acquire a slot before launching each goroutine and admit the expensive independent scenarios first. The concurrency cap remains two; all sessions, cleanup, nested test names and assertions remain intact.

Reduce the non-boundary mixed-type fixture from 2,000 base + 200 inserted rows to 274 + 137. Add explicit preconditions for updated/deleted/untouched rows on both the base and inserted sides. The SQL diff/replay and final table-equality assertions are unchanged. All 8,192-key PICK, physical-block, CSV and output-limit fixtures remain unchanged, as do cluster admission, runner scheduling, timeouts and production code.

Validation

Base 60985da109, macOS/arm64, Go 1.26.4. Both race binaries built through mo-cgo-test using the same native generation; baseline and candidate executed serially from the package directory with -test.count=3.

Parent test elapsed Baseline Candidate
Repetition 1 (includes cluster startup) 32.73s 30.46s
Repetition 2 26.22s 21.15s
Repetition 3 26.75s 21.09s
Total 85.70s 72.70s
  • Same 81 parent/child PASS occurrences in both runs; no failures or skips. Local parent elapsed decreased 15.2%; this is not a whole-CI speedup estimate.
  • Full pkg/tests/dml: normal PASS (36.498s), race PASS (90.345s).
  • Incremental golangci-lint (including govet): zero issues; gofmt and diff checks passed.
  • Initial focused execution traces confirm the same 27 test identities and a maximum of two active direct children before and after.

The coverage mapping, timing details and limitations are recorded in docs/design/DML_TEST_COST_REDUCTION.md. CI results are pending; no increase in concurrency or relaxation of coverage/assertions is used to obtain the improvement.

@XuPeng-SH
XuPeng-SH requested a review from fengttt as a code owner September 17, 2026 02:56
@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 17, 2026

Copy link
Copy Markdown
Contributor

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

  • Queue this pull request

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Force review for exact head b9491ab.

Scope reviewed: the complete DML fixture scheduling change, the six-cell reduced fixture precondition, and the design/evidence document.

  • The expensive scenarios are declared first, and semaphore admission happens before launching each goroutine. This preserves the two-slot cap while removing nondeterministic admission races; the deferred release still runs through child FailNow/runtime.Goexit paths, and the WaitGroup joins all admitted scenarios before shared cleanup.
  • Scenario names, SQL operations, assertions, session isolation, table namespace, boundary fixtures, and the 27 parent/child identities remain intact.
  • The reduced mixed-mutation fixture retains explicit base/inserted × updated/deleted/untouched cells, repeated composite-key components, and verifies the six expected counts before running the diff/replay assertions.
  • The design correctly limits the claim to this fixture and does not claim a runner, timeout, cluster-concurrency, or whole-suite change.
  • Current required checks are green, including Ubuntu UT, SCA, CI Required, and the existing package evidence. The PR is mergeable without conflict and only behind the base branch.

No evidence-backed P0/P1/P2 blocker found. This is a comment-only review because the PR is authored by the review requester.

VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…29031)

## What type of PR is this?

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

## Which issue(s) this PR fixes:

Related to matrixorigin#28419. This is a measured case-cost follow-up, not a claim
that the whole-suite timeout issue is closed.

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

`TestDataBranchDiffAsFile` holds the shared embedded cluster while
running 20 scenarios. It previously launched every scenario as a
goroutine before acquiring one of two execution slots, so the longest
scenario could start near the end and leave a long single-worker tail.
In CI run 35170421812, the parent took 70.24s and its 28.15s
special-column scenario started about 32s after the parent.

Acquire a slot before launching each goroutine and admit the expensive
independent scenarios first. The concurrency cap remains two; all
sessions, cleanup, nested test names and assertions remain intact.

Reduce the non-boundary mixed-type fixture from 2,000 base + 200
inserted rows to 274 + 137. Add explicit preconditions for
updated/deleted/untouched rows on both the base and inserted sides. The
SQL diff/replay and final table-equality assertions are unchanged. All
8,192-key PICK, physical-block, CSV and output-limit fixtures remain
unchanged, as do cluster admission, runner scheduling, timeouts and
production code.

### Validation

Base `60985da109`, macOS/arm64, Go 1.26.4. Both race binaries built
through `mo-cgo-test` using the same native generation; baseline and
candidate executed serially from the package directory with
`-test.count=3`.

| Parent test elapsed | Baseline | Candidate |
|---|---:|---:|
| Repetition 1 (includes cluster startup) | 32.73s | 30.46s |
| Repetition 2 | 26.22s | 21.15s |
| Repetition 3 | 26.75s | 21.09s |
| Total | 85.70s | 72.70s |

- Same 81 parent/child PASS occurrences in both runs; no failures or
skips. Local parent elapsed decreased 15.2%; this is not a whole-CI
speedup estimate.
- Full `pkg/tests/dml`: normal PASS (36.498s), race PASS (90.345s).
- Incremental golangci-lint (including govet): zero issues; gofmt and
diff checks passed.
- Initial focused execution traces confirm the same 27 test identities
and a maximum of two active direct children before and after.

The coverage mapping, timing details and limitations are recorded in
`docs/design/DML_TEST_COST_REDUCTION.md`. CI results are pending; no
increase in concurrency or relaxation of coverage/assertions is used to
obtain the improvement.

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
…29031)

## What type of PR is this?

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

## Which issue(s) this PR fixes:

Related to matrixorigin#28419. This is a measured case-cost follow-up, not a claim
that the whole-suite timeout issue is closed.

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

`TestDataBranchDiffAsFile` holds the shared embedded cluster while
running 20 scenarios. It previously launched every scenario as a
goroutine before acquiring one of two execution slots, so the longest
scenario could start near the end and leave a long single-worker tail.
In CI run 35170421812, the parent took 70.24s and its 28.15s
special-column scenario started about 32s after the parent.

Acquire a slot before launching each goroutine and admit the expensive
independent scenarios first. The concurrency cap remains two; all
sessions, cleanup, nested test names and assertions remain intact.

Reduce the non-boundary mixed-type fixture from 2,000 base + 200
inserted rows to 274 + 137. Add explicit preconditions for
updated/deleted/untouched rows on both the base and inserted sides. The
SQL diff/replay and final table-equality assertions are unchanged. All
8,192-key PICK, physical-block, CSV and output-limit fixtures remain
unchanged, as do cluster admission, runner scheduling, timeouts and
production code.

### Validation

Base `60985da109`, macOS/arm64, Go 1.26.4. Both race binaries built
through `mo-cgo-test` using the same native generation; baseline and
candidate executed serially from the package directory with
`-test.count=3`.

| Parent test elapsed | Baseline | Candidate |
|---|---:|---:|
| Repetition 1 (includes cluster startup) | 32.73s | 30.46s |
| Repetition 2 | 26.22s | 21.15s |
| Repetition 3 | 26.75s | 21.09s |
| Total | 85.70s | 72.70s |

- Same 81 parent/child PASS occurrences in both runs; no failures or
skips. Local parent elapsed decreased 15.2%; this is not a whole-CI
speedup estimate.
- Full `pkg/tests/dml`: normal PASS (36.498s), race PASS (90.345s).
- Incremental golangci-lint (including govet): zero issues; gofmt and
diff checks passed.
- Initial focused execution traces confirm the same 27 test identities
and a maximum of two active direct children before and after.

The coverage mapping, timing details and limitations are recorded in
`docs/design/DML_TEST_COST_REDUCTION.md`. CI results are pending; no
increase in concurrency or relaxation of coverage/assertions is used to
obtain the improvement.

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

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/enhancement 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