Skip to content

test: reduce and balance race UT work - #33066

Merged
XuPeng-SH merged 4 commits into
mainfrom
codex/main-ut-race-opt
Nov 23, 2026
Merged

XuPeng-SH merged 4 commits into
mainfrom
codex/main-ut-race-opt

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • Improvement
  • Test and CI

Which issue(s) this PR fixes:

Related to #28933 (follow-up on CPU/non-GPU UT runtime and scheduling).

What this PR does / why we need it:

The race UT job spends substantial time waiting for its longest SQL integration batch, while several issues tests repeat fixture DDL. Keep the existing runner and process limits, balance the four SQL integration batches using coarse historical race-cost hints, and remove fixture work that does not add a scenario. Hints only reorder roots discovered from the actual binary; unknown roots are retained and Go still runs each selected root in its normal binary order.

Original behavior Change Coverage retained
#31401 recreated a system peer for each mode Reuse one peer within each live cluster generation; assert it is empty before reuse. For one successful generation this removes up to 15 each of DROP DATABASE, CREATE DATABASE and CREATE TABLE, adding up to 15 count queries. All 16 modes, account differences, conflicting truncate, waits, errors, and original cleanup/quarantine remain. A failed generation is never reused.
#29400 created an independent database/table in both gate scenarios Create it only for shared_gate shared_gate still checks independent progress; exclusive_gate never used that fixture. All gate, two-CN, waiter, identity, and error checks remain.
#26087 always performed a second fallback snapshot drop Skip the fallback only after the required drop has succeeded Commit, replacement-BEGIN and rollback paths retain their snapshot and cleanup checks; the fallback remains for failed or uncertain drops.
SQL integration round-robin Stable hint ordering followed by round-robin, limited to the existing four-batch/four-worker configuration Actual binary inventory is validated before partitioning; each root remains in exactly one group. No runner, race test, retry, error path, or test result cache is added or removed.

Measured SQL integration phase

On host 57, the same race binary built from PR commit 0e5bf694b2240bccb93b359a51c70aba31d793ec was run under an 8-CPU, 16-GiB/no-swap cgroup, with the same four processes and GOMAXPROCS=2 per process. Both layouts selected all 112 discovered roots (28 per group) and had the same 899 root/subtest terminal outcomes (898 pass, 1 skip); the skip is the existing external-DSN-dependent test.

Metric Original Balanced
Phase wall time 274.35s 216.66s
CPU time, user + system 743.61s 733.03s
Cgroup memory peak 7.84 GiB 9.63 GiB
Process-accounted read bytes 138.40 MiB 20.73 MiB
Process-accounted write bytes 639.52 MiB 626.95 MiB

This measurement predates the subsequent merge of main into the PR. The binary SHA-256 was 127ac3188a34303276519a6780cecb3000a63f9a8993ac37e40a57216a02411f. The machine is shared and cache/host pressure may differ, so this single paired phase comparison is not an estimate of full CI-job savings. Host-wide accumulated CPU pressure was 9.76s vs 7.12s and I/O pressure was 13.41s vs 15.96s. The runs were sequential, so process-accounted read and write bytes are affected by caching and writeback; these numbers do not establish an I/O reduction. Compare peak memory as well as time before drawing conclusions about other runner sizes. Neither run hit the cgroup memory limit or OOM.

Validation

  • Go 1.27.1; go test -mod=readonly -race -short -tags matrixone_test -count=1 -parallel=4 -timeout=20m ./optools (entire owning package).
  • Native-verified race binary at commit 0e5bf694b2240bccb93b359a51c70aba31d793ec: TestIssue31401ScalarRefreshProgress once with all 16 modes; TestIssue26087ConcurrentDataBranchQuota and TestIssue29400CopyAlterRetainedGatePromotionFastFails twice each with all original subtests.
  • Failure injection after [Bug]: ALTER TABLE during in-flight LOAD DATA fails with txn write conflict instead of waiting #31401 peer insertion: the intentionally failed mode caused cluster quarantine, and the following mode passed on a different cluster generation; no race or panic was reported.
  • gofmt, bash -n, git diff --check, scoped go vet, repository molint, and configured incremental golangci-lint passed.
  • The latest merged PR head f3f88998ba354ad4a729ebf3fe3b25930df4d973 also passed the inventory and three focused issues race tests in the mo-bot review. GitHub CI remains the source of end-to-end job timing and resource results.

@XuPeng-SH
XuPeng-SH requested a review from fengttt as a code owner November 22, 2026 18:55
@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 22, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@XuPeng-SH

XuPeng-SH commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Commit: 0e5bf694b2240bccb93b359a51c70aba31d793ec

"interrupted"

@XuPeng-SH

XuPeng-SH commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Commit: f3f88998ba354ad4a729ebf3fe3b25930df4d973

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: f3f88998ba354ad4a729ebf3fe3b25930df4d973

Assessment: request_changes

The scheduler reuses the existing dispatcher and assigns each discovered test root exactly once. The fixture changes preserve the existing assertions and failure cleanup. The PR body still needs the repository-required issue reference.

Model: gpt-6.2-sol / xhigh

Session: 01a1f0a0-5126-78f3-9ab8-ef4e87f2f119 · slot 0 · generation 3

  • P3 .github/PULL_REQUEST_TEMPLATE.md:11: The frozen PR body contains N/A in the issue section.
    Impact: The PR misses a mandatory delivery requirement. The frozen CI record shows failed preflight and required checks, with the unit-test job skipped.
    Evidence: The pinned github-delivery.md at lines 16–20 requires a real, relevant issue reference in this section. .github/workflows/entrypoint.yaml checks the section at lines 44–49 and gates the unit-test job at line 127. Replace N/A with a follow-up reference such as Related to #26087 and confirm that CI reaches the changed runner.

Validation:

  • Verified the frozen diff, pinned policy, Bash syntax, Go formatting, and full CI classification. See static.log, delivery-check.log, and review-validation.md for the matching receipts.

  • Both current-head inventory tests passed under the race detector. See inventory-race.log and checks/1795375135585572914-2.json. The earlier full optools race run remains applicable because the runner and build inputs matched across the rebase.

  • All three current-head embedded regressions passed under the race detector, including all 16 scalar-refresh modes and both gate scenarios, with zero skips. See issues-race.log and checks/1795375442451888507-2.json.

Limitations:

  • The frozen CI record omits preflight step logs, so the cause of the failure remains unverified.

  • The author reports a SQL-integration phase reduction from 274.35 s to 216.66 s and a peak memory increase from 7.84 GiB to 9.63 GiB. That paired run lacks a verified binary fingerprint for the rebased head. Full CI job timing and cold-runner resource use remain unverified.

This branch was successfully deployed

No deployments
ci — 2bcadb56 Deployed Nov 23, 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/test-ci size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants