Skip to content

test: reduce high-cost integration fixtures deterministically - #27613

Merged
XuPeng-SH merged 3 commits into
mainfrom
codex/optimize-data-branch-ut-fixtures
Aug 26, 2026
Merged

XuPeng-SH merged 3 commits into
mainfrom
codex/optimize-data-branch-ut-fixtures

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Aug 26, 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:

issue #27571

What this PR does / why we need it:

This reduces high-cost integration-test setup while preserving the original semantic matrices and strengthening deterministic oracles. No production code is changed.

Data Branch DML fixtures

  • Shares database and cluster fixtures across compatible diff, pick, and regression scenarios while keeping isolated tables and fresh-context cleanup.
  • Replaces oversized inputs with the smallest structural boundaries that retain multiple object blocks, three blocks plus a tail, and two 8192-key pick chunks plus untouched rows.
  • Keeps conflict policies, key types/coercion, mixed DML, snapshots, transaction rejection, remote multi-CN scope, and unhappy paths.
  • Replaces log-only/no-error checks with exact chunk layouts, affected-row counts, unchanged-state checks, and exact result sets.
  • Reduces issue 26568 from 260,000 generated values to two matching rows per side because its renderer contract is driven by explicitly patched optimizer statistics.

High-cost issues and resource fixtures

  • Keeps the issue 26095 matrix at 2 account contexts x 3 deletion entry points. Table deletion retains the reported four independent sessions, but removes duplicate system-account rounds. A ready barrier admits every connection before release; catalog rows, branch snapshots, and object deletion are checked exactly.
  • Builds the issue 26123 source schema once and copies it once per Data Branch/CLONE mode. All 2 modes x 3 LIKE-metacharacter identifiers remain named subtests, including collision tables, exact FK catalog identity, copied rows, and rejected invalid FK writes.
  • Reduces issue 26131 from 100,000 lineitem rows to two real SUM groups with four rows. EXPLAIN now requires exactly one lineitem producer and exactly two Sink Scan consumers, and the result is exact.
  • Derives TestLockNeedUpgrade input from the real MaxLockRowCount boundary (10,002 rows in the default cluster instead of 20,000 twice). Both local-owner and remote-proxy paths inspect the live lock service for range-lock coarsening and verify the terminal row count.
  • Reduces the broadcast hard-budget fixture from 200,000 to 66,048 rows while retaining the grouped-child/broadcast topology, controlled OOM classification, no-spill assertion, no partial result, and post-error health check.
  • Reduces the eight-worker HashBuild recovery fixture from 1,000,000 to 786,944 rows while retaining the original 28 MiB cap, late map-admission recovery, expression-key shuffle topology, exact result, spill metric, and post-query health check.

Metadata and account integration fixtures

  • Reuses one source database for ordinary internal-looking tables and fulltext storage across Data Branch and CLONE. The 2 copy modes, 3 ordinary names, hidden fulltext storage, and copied data remain exact named assertions.
  • Reuses one branch lineage across the 3 delete-validation identifier cases. Each case still independently proves the exact rejection and unchanged row, while cleanup now removes snapshots on failure.
  • Batches issue 26232 information_schema.columns and DESC reads without removing any per-view or per-column default assertion.
  • Replaces issue 26111's three open-ended internal catalog polling loops with direct target-tenant SQL checks after the cross-account DDL commits. Cyclic rows, both FK catalog entries, both invalid writes, duplicate-create state, and session restoration are still checked exactly through the public user path.

Coverage and timing evidence

  • DML A/B coverage across frontend, compile, and plan increased from 26.7% to 27.4%; the frontend data_branch target has no baseline-only blocks, and data_branch_pick.go keeps the exact same covered-block set.
  • Instrumented HashBuild/HashJoin/Group A/B coverage increased from 45.0% to 45.1%. The late map-admission and recovery blocks are retained; residual block-set differences are limited to concurrent spill-buffer empty/full and sealed-mailbox scheduling branches.
  • Instrumented isolated resource tests improved from 29.065s to 25.660s on the same host, saving 3.405s (11.7%).
  • The named issue-test bodies improved from 2.67s to 1.29s on the same host, saving 1.38s (51.7%); shared cluster startup is excluded.
  • The selected DML matrix improved from 17.057s to 14.021s, saving 3.036s (17.8%).
  • In the additional batch, issue 26121 improved from 0.80s to 0.58s and issue 26232 from 0.59s to 0.13s on the same shared-cluster run, saving 0.68s (48.9%) across those test bodies.
  • A/B statement coverage for pkg/frontend and pkg/sql/compile is unchanged at 23.3%. The semantic matrices above are unchanged; issue 26111 intentionally moves incidental coverage from the internal executor to the real frontend authentication/session path.

Validation

  • go test ./pkg/tests/dml -count=1
  • go test -race ./pkg/tests/dml -count=1
  • Normal and race runs for all changed issue tests
  • Normal and race runs for both isolated HashBuild resource tests
  • Final recovery diagnostics: all 8 shuffle workers reported one spill and no pipeline failure
  • Final broadcast diagnostics: exact 1 MiB hard-budget rejection and no HashBuild spill
  • Deliberate FailNow probe for the shared DML fixture cleanup
  • Post-rebase exact normal run for the three additional issue tests
  • gofmt and git diff --check

The branch is rebased on 428ce80cb8 (current origin/main when pushed).

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

@matrix-meow matrix-meow added the size/L Denotes a PR that changes [500,999] lines label Aug 26, 2026
@XuPeng-SH XuPeng-SH changed the title test: consolidate heavy data branch fixtures test: reduce high-cost integration fixtures deterministically Aug 26, 2026
@matrix-meow matrix-meow added size/XL Denotes a PR that changes [1000, 1999] lines and removed size/L Denotes a PR that changes [500,999] lines labels Aug 26, 2026
@XuPeng-SH
XuPeng-SH merged commit 5bc051a into main Aug 26, 2026
32 checks passed
@XuPeng-SH
XuPeng-SH deleted the codex/optimize-data-branch-ut-fixtures branch August 26, 2026 03:22
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…origin#27613)

## What type of PR is this?

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

## Which issue(s) this PR fixes:

issue matrixorigin#27571

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

This reduces high-cost integration-test setup while preserving the
original semantic matrices and strengthening deterministic oracles. No
production code is changed.

### Data Branch DML fixtures

- Shares database and cluster fixtures across compatible diff, pick, and
regression scenarios while keeping isolated tables and fresh-context
cleanup.
- Replaces oversized inputs with the smallest structural boundaries that
retain multiple object blocks, three blocks plus a tail, and two
8192-key pick chunks plus untouched rows.
- Keeps conflict policies, key types/coercion, mixed DML, snapshots,
transaction rejection, remote multi-CN scope, and unhappy paths.
- Replaces log-only/no-error checks with exact chunk layouts,
affected-row counts, unchanged-state checks, and exact result sets.
- Reduces issue 26568 from 260,000 generated values to two matching rows
per side because its renderer contract is driven by explicitly patched
optimizer statistics.

### High-cost issues and resource fixtures

- Keeps the issue 26095 matrix at 2 account contexts x 3 deletion entry
points. Table deletion retains the reported four independent sessions,
but removes duplicate system-account rounds. A ready barrier admits
every connection before release; catalog rows, branch snapshots, and
object deletion are checked exactly.
- Builds the issue 26123 source schema once and copies it once per Data
Branch/CLONE mode. All 2 modes x 3 LIKE-metacharacter identifiers remain
named subtests, including collision tables, exact FK catalog identity,
copied rows, and rejected invalid FK writes.
- Reduces issue 26131 from 100,000 lineitem rows to two real SUM groups
with four rows. EXPLAIN now requires exactly one lineitem producer and
exactly two Sink Scan consumers, and the result is exact.
- Derives TestLockNeedUpgrade input from the real MaxLockRowCount
boundary (10,002 rows in the default cluster instead of 20,000 twice).
Both local-owner and remote-proxy paths inspect the live lock service
for range-lock coarsening and verify the terminal row count.
- Reduces the broadcast hard-budget fixture from 200,000 to 66,048 rows
while retaining the grouped-child/broadcast topology, controlled OOM
classification, no-spill assertion, no partial result, and post-error
health check.
- Reduces the eight-worker HashBuild recovery fixture from 1,000,000 to
786,944 rows while retaining the original 28 MiB cap, late map-admission
recovery, expression-key shuffle topology, exact result, spill metric,
and post-query health check.

### Metadata and account integration fixtures

- Reuses one source database for ordinary internal-looking tables and
fulltext storage across Data Branch and CLONE. The 2 copy modes, 3
ordinary names, hidden fulltext storage, and copied data remain exact
named assertions.
- Reuses one branch lineage across the 3 delete-validation identifier
cases. Each case still independently proves the exact rejection and
unchanged row, while cleanup now removes snapshots on failure.
- Batches issue 26232 `information_schema.columns` and `DESC` reads
without removing any per-view or per-column default assertion.
- Replaces issue 26111's three open-ended internal catalog polling loops
with direct target-tenant SQL checks after the cross-account DDL
commits. Cyclic rows, both FK catalog entries, both invalid writes,
duplicate-create state, and session restoration are still checked
exactly through the public user path.

### Coverage and timing evidence

- DML A/B coverage across frontend, compile, and plan increased from
26.7% to 27.4%; the frontend data_branch target has no baseline-only
blocks, and data_branch_pick.go keeps the exact same covered-block set.
- Instrumented HashBuild/HashJoin/Group A/B coverage increased from
45.0% to 45.1%. The late map-admission and recovery blocks are retained;
residual block-set differences are limited to concurrent spill-buffer
empty/full and sealed-mailbox scheduling branches.
- Instrumented isolated resource tests improved from 29.065s to 25.660s
on the same host, saving 3.405s (11.7%).
- The named issue-test bodies improved from 2.67s to 1.29s on the same
host, saving 1.38s (51.7%); shared cluster startup is excluded.
- The selected DML matrix improved from 17.057s to 14.021s, saving
3.036s (17.8%).
- In the additional batch, issue 26121 improved from 0.80s to 0.58s and
issue 26232 from 0.59s to 0.13s on the same shared-cluster run, saving
0.68s (48.9%) across those test bodies.
- A/B statement coverage for `pkg/frontend` and `pkg/sql/compile` is
unchanged at 23.3%. The semantic matrices above are unchanged; issue
26111 intentionally moves incidental coverage from the internal executor
to the real frontend authentication/session path.

### Validation

- `go test ./pkg/tests/dml -count=1`
- `go test -race ./pkg/tests/dml -count=1`
- Normal and race runs for all changed issue tests
- Normal and race runs for both isolated HashBuild resource tests
- Final recovery diagnostics: all 8 shuffle workers reported one spill
and no pipeline failure
- Final broadcast diagnostics: exact 1 MiB hard-budget rejection and no
HashBuild spill
- Deliberate FailNow probe for the shared DML fixture cleanup
- Post-rebase exact normal run for the three additional issue tests
- `gofmt` and `git diff --check`

The branch is rebased on `428ce80cb8` (current `origin/main` when
pushed).
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…origin#27613)

## What type of PR is this?

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

## Which issue(s) this PR fixes:

issue matrixorigin#27571

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

This reduces high-cost integration-test setup while preserving the
original semantic matrices and strengthening deterministic oracles. No
production code is changed.

### Data Branch DML fixtures

- Shares database and cluster fixtures across compatible diff, pick, and
regression scenarios while keeping isolated tables and fresh-context
cleanup.
- Replaces oversized inputs with the smallest structural boundaries that
retain multiple object blocks, three blocks plus a tail, and two
8192-key pick chunks plus untouched rows.
- Keeps conflict policies, key types/coercion, mixed DML, snapshots,
transaction rejection, remote multi-CN scope, and unhappy paths.
- Replaces log-only/no-error checks with exact chunk layouts,
affected-row counts, unchanged-state checks, and exact result sets.
- Reduces issue 26568 from 260,000 generated values to two matching rows
per side because its renderer contract is driven by explicitly patched
optimizer statistics.

### High-cost issues and resource fixtures

- Keeps the issue 26095 matrix at 2 account contexts x 3 deletion entry
points. Table deletion retains the reported four independent sessions,
but removes duplicate system-account rounds. A ready barrier admits
every connection before release; catalog rows, branch snapshots, and
object deletion are checked exactly.
- Builds the issue 26123 source schema once and copies it once per Data
Branch/CLONE mode. All 2 modes x 3 LIKE-metacharacter identifiers remain
named subtests, including collision tables, exact FK catalog identity,
copied rows, and rejected invalid FK writes.
- Reduces issue 26131 from 100,000 lineitem rows to two real SUM groups
with four rows. EXPLAIN now requires exactly one lineitem producer and
exactly two Sink Scan consumers, and the result is exact.
- Derives TestLockNeedUpgrade input from the real MaxLockRowCount
boundary (10,002 rows in the default cluster instead of 20,000 twice).
Both local-owner and remote-proxy paths inspect the live lock service
for range-lock coarsening and verify the terminal row count.
- Reduces the broadcast hard-budget fixture from 200,000 to 66,048 rows
while retaining the grouped-child/broadcast topology, controlled OOM
classification, no-spill assertion, no partial result, and post-error
health check.
- Reduces the eight-worker HashBuild recovery fixture from 1,000,000 to
786,944 rows while retaining the original 28 MiB cap, late map-admission
recovery, expression-key shuffle topology, exact result, spill metric,
and post-query health check.

### Metadata and account integration fixtures

- Reuses one source database for ordinary internal-looking tables and
fulltext storage across Data Branch and CLONE. The 2 copy modes, 3
ordinary names, hidden fulltext storage, and copied data remain exact
named assertions.
- Reuses one branch lineage across the 3 delete-validation identifier
cases. Each case still independently proves the exact rejection and
unchanged row, while cleanup now removes snapshots on failure.
- Batches issue 26232 `information_schema.columns` and `DESC` reads
without removing any per-view or per-column default assertion.
- Replaces issue 26111's three open-ended internal catalog polling loops
with direct target-tenant SQL checks after the cross-account DDL
commits. Cyclic rows, both FK catalog entries, both invalid writes,
duplicate-create state, and session restoration are still checked
exactly through the public user path.

### Coverage and timing evidence

- DML A/B coverage across frontend, compile, and plan increased from
26.7% to 27.4%; the frontend data_branch target has no baseline-only
blocks, and data_branch_pick.go keeps the exact same covered-block set.
- Instrumented HashBuild/HashJoin/Group A/B coverage increased from
45.0% to 45.1%. The late map-admission and recovery blocks are retained;
residual block-set differences are limited to concurrent spill-buffer
empty/full and sealed-mailbox scheduling branches.
- Instrumented isolated resource tests improved from 29.065s to 25.660s
on the same host, saving 3.405s (11.7%).
- The named issue-test bodies improved from 2.67s to 1.29s on the same
host, saving 1.38s (51.7%); shared cluster startup is excluded.
- The selected DML matrix improved from 17.057s to 14.021s, saving
3.036s (17.8%).
- In the additional batch, issue 26121 improved from 0.80s to 0.58s and
issue 26232 from 0.59s to 0.13s on the same shared-cluster run, saving
0.68s (48.9%) across those test bodies.
- A/B statement coverage for `pkg/frontend` and `pkg/sql/compile` is
unchanged at 23.3%. The semantic matrices above are unchanged; issue
26111 intentionally moves incidental coverage from the internal executor
to the real frontend authentication/session path.

### Validation

- `go test ./pkg/tests/dml -count=1`
- `go test -race ./pkg/tests/dml -count=1`
- Normal and race runs for all changed issue tests
- Normal and race runs for both isolated HashBuild resource tests
- Final recovery diagnostics: all 8 shuffle workers reported one spill
and no pipeline failure
- Final broadcast diagnostics: exact 1 MiB hard-budget rejection and no
HashBuild spill
- Deliberate FailNow probe for the shared DML fixture cleanup
- Post-rebase exact normal run for the three additional issue tests
- `gofmt` and `git diff --check`

The branch is rebased on `428ce80cb8` (current `origin/main` when
pushed).
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…origin#27613)

## What type of PR is this?

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

## Which issue(s) this PR fixes:

issue matrixorigin#27571

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

This reduces high-cost integration-test setup while preserving the
original semantic matrices and strengthening deterministic oracles. No
production code is changed.

### Data Branch DML fixtures

- Shares database and cluster fixtures across compatible diff, pick, and
regression scenarios while keeping isolated tables and fresh-context
cleanup.
- Replaces oversized inputs with the smallest structural boundaries that
retain multiple object blocks, three blocks plus a tail, and two
8192-key pick chunks plus untouched rows.
- Keeps conflict policies, key types/coercion, mixed DML, snapshots,
transaction rejection, remote multi-CN scope, and unhappy paths.
- Replaces log-only/no-error checks with exact chunk layouts,
affected-row counts, unchanged-state checks, and exact result sets.
- Reduces issue 26568 from 260,000 generated values to two matching rows
per side because its renderer contract is driven by explicitly patched
optimizer statistics.

### High-cost issues and resource fixtures

- Keeps the issue 26095 matrix at 2 account contexts x 3 deletion entry
points. Table deletion retains the reported four independent sessions,
but removes duplicate system-account rounds. A ready barrier admits
every connection before release; catalog rows, branch snapshots, and
object deletion are checked exactly.
- Builds the issue 26123 source schema once and copies it once per Data
Branch/CLONE mode. All 2 modes x 3 LIKE-metacharacter identifiers remain
named subtests, including collision tables, exact FK catalog identity,
copied rows, and rejected invalid FK writes.
- Reduces issue 26131 from 100,000 lineitem rows to two real SUM groups
with four rows. EXPLAIN now requires exactly one lineitem producer and
exactly two Sink Scan consumers, and the result is exact.
- Derives TestLockNeedUpgrade input from the real MaxLockRowCount
boundary (10,002 rows in the default cluster instead of 20,000 twice).
Both local-owner and remote-proxy paths inspect the live lock service
for range-lock coarsening and verify the terminal row count.
- Reduces the broadcast hard-budget fixture from 200,000 to 66,048 rows
while retaining the grouped-child/broadcast topology, controlled OOM
classification, no-spill assertion, no partial result, and post-error
health check.
- Reduces the eight-worker HashBuild recovery fixture from 1,000,000 to
786,944 rows while retaining the original 28 MiB cap, late map-admission
recovery, expression-key shuffle topology, exact result, spill metric,
and post-query health check.

### Metadata and account integration fixtures

- Reuses one source database for ordinary internal-looking tables and
fulltext storage across Data Branch and CLONE. The 2 copy modes, 3
ordinary names, hidden fulltext storage, and copied data remain exact
named assertions.
- Reuses one branch lineage across the 3 delete-validation identifier
cases. Each case still independently proves the exact rejection and
unchanged row, while cleanup now removes snapshots on failure.
- Batches issue 26232 `information_schema.columns` and `DESC` reads
without removing any per-view or per-column default assertion.
- Replaces issue 26111's three open-ended internal catalog polling loops
with direct target-tenant SQL checks after the cross-account DDL
commits. Cyclic rows, both FK catalog entries, both invalid writes,
duplicate-create state, and session restoration are still checked
exactly through the public user path.

### Coverage and timing evidence

- DML A/B coverage across frontend, compile, and plan increased from
26.7% to 27.4%; the frontend data_branch target has no baseline-only
blocks, and data_branch_pick.go keeps the exact same covered-block set.
- Instrumented HashBuild/HashJoin/Group A/B coverage increased from
45.0% to 45.1%. The late map-admission and recovery blocks are retained;
residual block-set differences are limited to concurrent spill-buffer
empty/full and sealed-mailbox scheduling branches.
- Instrumented isolated resource tests improved from 29.065s to 25.660s
on the same host, saving 3.405s (11.7%).
- The named issue-test bodies improved from 2.67s to 1.29s on the same
host, saving 1.38s (51.7%); shared cluster startup is excluded.
- The selected DML matrix improved from 17.057s to 14.021s, saving
3.036s (17.8%).
- In the additional batch, issue 26121 improved from 0.80s to 0.58s and
issue 26232 from 0.59s to 0.13s on the same shared-cluster run, saving
0.68s (48.9%) across those test bodies.
- A/B statement coverage for `pkg/frontend` and `pkg/sql/compile` is
unchanged at 23.3%. The semantic matrices above are unchanged; issue
26111 intentionally moves incidental coverage from the internal executor
to the real frontend authentication/session path.

### Validation

- `go test ./pkg/tests/dml -count=1`
- `go test -race ./pkg/tests/dml -count=1`
- Normal and race runs for all changed issue tests
- Normal and race runs for both isolated HashBuild resource tests
- Final recovery diagnostics: all 8 shuffle workers reported one spill
and no pipeline failure
- Final broadcast diagnostics: exact 1 MiB hard-budget rejection and no
HashBuild spill
- Deliberate FailNow probe for the shared DML fixture cleanup
- Post-rebase exact normal run for the three additional issue tests
- `gofmt` and `git diff --check`

The branch is rebased on `428ce80cb8` (current `origin/main` when
pushed).

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/refactor Code refactor kind/test-ci size/XL Denotes a PR that changes [1000, 1999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants