Repository navigation
test: reduce race UT fixture and admission work - #33313
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
This pull request is merged. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 4b98b2edf96fb1d65dfc3a90b180a31df5edb1da
Assessment: approve
The test optimizations retain the affected concurrency, SQL result, metadata, and failure-atomicity checks while reusing fixtures and reducing setup work. No actionable findings remain.
Model: gpt-6.1-terra / max
Session: 01a216bc-adbc-7142-8f93-6b94a5827118 · slot 0 · generation 16
Validation:
-
The throttler package passed with -race -short, and the changed TestParallel passed 100 focused race repetitions. Logs and receipts are recorded in review-validation.json.
-
All four changed SQL integration roots passed with -race -short -tags matrixone_test against the embedded single-CN frontend; sqlintegration-race.log and checks/1795688838605668935-2.json.
-
An independent arithmetic check verified the revised OR aggregates and integer grouping expectations. Private-runtime preflight, native input provenance, and git diff --check passed.
Limitations:
-
The full SQL suite and the PR's reported before-and-after performance measurements were not independently repeated. The reported wall-time comparison is one author-run sample with acknowledged host-load and I/O differences.
-
The frozen CI snapshot showed the x86 UT job queued; it was not treated as a pass.
## 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: 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.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #28933.
What this PR does / why we need it:
Recent main-target race CI runs spend several minutes in the SQL integration stage. The previous balancing change keeps the four batches busy. This change reduces work inside the cases and preserves the existing schedule.
Validation uses Go 1.27.1,
-race -short -tags matrixone_test, four batches selected by main's existing cost-based partitioner, two Go cores per binary, and an eight-CPU, 16 GiB no-swap cgroup. The throttle package passes race in full and the concurrent admission cases pass 50 repetitions. Incremental SCA for both changed packages reports zero issues.Both SQL runs passed with identical terminal results for all 116 roots and 911 root/subtest outcomes (910 pass, one existing external-DSN skip).
This is one same-host A/B sample. The baseline started with some unrelated host load and cold I/O, so wall time and read bytes are especially sensitive to run order. This measures the affected SQL stage, not full CI. No CI schedule or production code is changed.