Skip to content

test: reduce race UT model and engine fixture costs - #33322

Merged
XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
XuPeng-SH:test/main-race-engine-fixtures
Nov 26, 2026
Merged

XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
XuPeng-SH:test/main-race-engine-fixtures

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 #28933. Follow-up to #33313.

What this PR does / why we need it:

Three parts of race UT spend resources on fixture work that can be reduced while keeping their behavioral checks:

  • The S3-FIFO reference model still runs 80,000 seeded operations and checks accounting and the full resident set after each one. It checks the public membership API for the operated key and checks all resident keys, their expected shard, and cardinality directly. This avoids locking for each of the 400 possible keys.
  • The index-file engine test writes 66 chunks. The test runs two real INSERTs (65 + 1 chunks) against the same registered source and transaction. The first crosses the table function's 64-row output boundary and the second carries the short final chunk. Reconstruction, cache, persistence, duplicate rejection and rollback, snapshot and range-filter assertions remain. The existing table-function test separately runs public Write across two INSERT statements and checks IDs, exact bytes and CRC.
  • Two publication tests capture the full catalog on failure before engine teardown. The index replication test seeds the same 10 tuples with one INSERT before replication begins. These tests retain engine DEBUG and the iteration state, row, index and DDL assertions.

Local race A/B with Go 1.27.1, GOMAXPROCS=2 and disk-backed scratch:

Test scope Metric Base Candidate
S3-FIFO model CPU 8.83 s 2.66 s
3 affected engine tests Wall 19.52 s 11.53 s
3 affected engine tests CPU 11.51 s 4.02 s
3 affected engine tests Process writes 257 MiB 21 MiB
3 affected engine tests Process peak RSS 2.82 GiB 0.84 GiB

Each comparison is one local sample. Aggregate engine stdout was 2.70 MB in the baseline and 2.37 MB in the final sample. An earlier candidate sample was flat, so this comparison does not establish a stable reduction in structured engine logging. The S3-FIFO model's sampled RSS rose from 44.6 to 54.3 MiB. The engine result is scoped to the three tests and does not measure the full CI job.

The full S3-FIFO package passed race. All three touched engine tests and both neighboring index-file tests passed race with matrixone_test enabled. The existing table-function split test passed all four subtests in the same race mode. Incremental SCA passed for the changed packages.

@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 Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@XuPeng-SH

XuPeng-SH commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Commit: 332a60ec0770c37ad14a482fe4363f7367540379

Review completed. Read the assessment.

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

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

Commit: 332a60ec0770c37ad14a482fe4363f7367540379

Assessment: approve

The test optimizations preserve the cache resident-set oracle, cover the production index-file split in the existing table-function test, and retain real-engine batch and transaction coverage. The publication assertions remain intact; its seed now uses one transaction, while later transaction and deletion coverage remains elsewhere.

Model: gpt-6.1-terra / max

Session: 01a2179b-7a0e-7812-94c2-dc2707e03412 · slot 0 · generation 18

Validation:

  • Isolation preflight passed. All four changed tests and the retained index-file split test passed with race instrumentation and the matrixone_test tag. Log: focused-race.log; receipt: checks/1795702873417787362-2.json.

  • A two-run baseline comparison used the original test files over unchanged production source, with race instrumentation and GOMAXPROCS=2. Cache-model test times fell from 13.12–13.19s to 3.18s; index-file engine test times fell from 8.58–8.85s to 2.00–2.18s. Both publication tests passed twice in each version. Logs: baseline-race-ab.jsonl and candidate-race-ab.jsonl; receipts: checks/1795702973686772500-2.json and checks/1795703016809070098-2.json.

Limitations:

  • The frozen CI snapshot showed the UT and SCA jobs in progress. Their eventual results and the author's CPU and memory measurements were not independently verified.

This branch was successfully deployed

No deployments
ci — aa04924d Deployed Nov 26, 2026 by XuPeng-SH
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/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants