Repository navigation
test: overlap plan UT within the single-runner budget - #28632
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? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Force review of d4f9248 against main 9a07655: no concrete blocker found. COMMENT only for this self-authored PR.
Design: independently PASS revision 6 of docs/design/UT_EXECUTION_AND_FIXTURE_OPTIMIZATION.md (blob f464fd86a80ec2f18bbd2812e5b48ce1f32f79fa). Released-slot scheduling, one authoritative report writer, bounded cancellation, unchanged test selection and an explicit sequential fallback are coherent. The previous opt-in policy is explicitly superseded rather than silently contradicted.
Reviewed the full diff, live comments and the scheduler's package discovery, engine/plan helpers, process-group cleanup, report transfer and final status consumers.
- Coverage/identity: package partition validation is unchanged and fails on omissions/duplicates. Plan still compiles once with -race/-p1, discovers all Test/Fuzz/Example targets, preserves package cwd/import identity and runs its existing shards sequentially in fresh processes. No cases, race flags, assertions, or timeout reductions are introduced.
- Scheduling: a nonempty concurrent engine PID is required for overlap. Joining that helper precedes plan admission; at budget 3, engine(2)+resource(1) becomes plan(1)+resource(1). Budgets 1/2 and higher-precedence/non-sharded engine paths retain sequential plan execution. engine_joined prevents an early-joined engine from running twice, and its failure remains part of the final failure aggregation while plan still runs.
- Reporting: the foreground PID and command metadata survive the engine join. Engine report publication waits for the heavy writer to exit; plan uses a private report and is joined before consumption. Thus atomic report replacement cannot detach an active heavy writer.
- CI: the live reusable workflow maps ut_sharded=false to the all-stage matrix entry and keeps the established UT Test on Ubuntu/x86 name; it does not select only the heavy/plan subset. The pull_request_target/base-caller limitation described in the PR is real, so this PR's four-job run alone cannot validate the post-merge single-runner topology.
Lifecycle closure:
| Dimension | Checked terminal boundary |
|---|---|
| Q1 ownership | Parent owns command/helper PIDs; helpers own descendants; stopped reports are consumed once. |
| Q2 liveness | TERM reaches all owned groups before waits; existing bounded TERM/KILL cleanup and outer timeout remain. |
| Q3 bounds | Existing heavy process budget retained; one plan child at a time; no new cluster admission or unbounded queue. |
The new scheduling oracle is substantive: heavy cannot finish until plan starts, engine must finish first, exactly-once directories and complete report suffixes detect skipped/duplicate execution or lost writes, and each stage's nonzero status is checked. Cancellation requires both writers' terminal markers before report merge. Tests use private repository layouts, avoiding the real runner's destructive startup diagnostics.
Evidence: exact-head bash syntax and git diff --check passed. Reused the reported focused race repetitions, owning optools race run, vet, workflow contract test, and real race-heavy/plan comparison; these were not rerun by me. The reported 16,013 matching test/subtest events and terminal statuses support sample coverage equivalence. The 24.4% gain is a warm local macOS stage sample, not a Linux CI or full-job result; target Linux peak memory/contention and net elapsed remain operational follow-up, not a demonstrated blocker. Head/base were unchanged immediately before submission. No CI wait or repository edits.
…8632) ## What type of PR is this? - [x] Improvement - [x] Test and CI ## Which issue(s) this PR fixes: Related to matrixorigin#28419 and matrixorigin#28538. ## What this PR does / why we need it: Keep the complete race-UT suite on one runner and reuse engine capacity to run plan tests while the remaining resource-heavy tests finish. A historical single-runner trace left engine slots idle from 06:22:22 to 06:26:04, then ran plan for about another 2m20s. With the default budget of three, execution changes from `engine(2) + resource(1)` to `plan(1) + resource(1)` after engine exits. Plan compilation retains `-p1`. `UT_OVERLAP_PLAN=1` enables this by default; `0` provides the sequential baseline. Budgets of one/two and paths without a concurrent engine helper keep sequential execution. The CI caller restores `ut_sharded: false`, undoing matrixorigin#28575's multi-runner topology; that restoration itself is not counted as a speedup against the previous single-runner baseline. The parent keeps the foreground PID and independent command metadata while joining engine. Engine failure remains a failure and does not skip plan. Report merging waits for the heavy writer to exit, avoiding data loss from renaming an open output file. Cancellation signals all owned groups before bounded waits and merges stopped writers only. No test cases, data sizes, assertions, race flags, timeouts, cluster admission, or coverage jobs are weakened. The logservice companion experiment was removed: package elapsed time alone did not demonstrate critical-path savings. ### Validation - `go test -race ./optools -count=1` - Both new scheduling/cancellation tests passed individually with `-race -count=3`; scheduling covers defaults, overlap, each stage failing, sequential mode, and budgets 1/2. - `go vet ./optools` - `node --test .github/ci/change-scope.test.cjs` - `bash -n optools/run_ut.sh` and `git diff --check` - Independent GPT-6 medium review: no blocking or medium findings. - Real heavy/plan runs passed with the repository CGo wrapper, `-race`, `matrixone_test`, and the unchanged three-slot budget. The warm sequential baseline took 303.11s; overlap took 229.19s: 73.92s (24.4%) less elapsed time for this local stage sample. Both runs had exactly the same 16,013 test/subtest start events and terminal statuses, with zero failures. - A first cold baseline took 440.04s and is excluded from the claimed gain. Measurement order was cold sequential, warm overlap, then warm sequential. This is one local macOS comparison, not a controlled Linux CI benchmark. The heavy/plan scheduler was invoked directly, with existing native artifacts verified by the official wrapper; checkout, native prerequisite rebuild, and full-suite setup were excluded equally from both measurements. External-service eligibility remains environment-dependent. - The historical CI trace suggests roughly 2m20s of potential overlap; this is not a measured CI saving. Target Linux CI still needs to confirm peak memory and net elapsed time. This repository uses `pull_request_target`, so this PR still uses the base workflow's four-job caller until merged. Its heavy-plan job does execute the updated scheduler from the PR head; the single-runner caller is covered by the workflow contract test.
…8632) ## What type of PR is this? - [x] Improvement - [x] Test and CI ## Which issue(s) this PR fixes: Related to matrixorigin#28419 and matrixorigin#28538. ## What this PR does / why we need it: Keep the complete race-UT suite on one runner and reuse engine capacity to run plan tests while the remaining resource-heavy tests finish. A historical single-runner trace left engine slots idle from 06:22:22 to 06:26:04, then ran plan for about another 2m20s. With the default budget of three, execution changes from `engine(2) + resource(1)` to `plan(1) + resource(1)` after engine exits. Plan compilation retains `-p1`. `UT_OVERLAP_PLAN=1` enables this by default; `0` provides the sequential baseline. Budgets of one/two and paths without a concurrent engine helper keep sequential execution. The CI caller restores `ut_sharded: false`, undoing matrixorigin#28575's multi-runner topology; that restoration itself is not counted as a speedup against the previous single-runner baseline. The parent keeps the foreground PID and independent command metadata while joining engine. Engine failure remains a failure and does not skip plan. Report merging waits for the heavy writer to exit, avoiding data loss from renaming an open output file. Cancellation signals all owned groups before bounded waits and merges stopped writers only. No test cases, data sizes, assertions, race flags, timeouts, cluster admission, or coverage jobs are weakened. The logservice companion experiment was removed: package elapsed time alone did not demonstrate critical-path savings. ### Validation - `go test -race ./optools -count=1` - Both new scheduling/cancellation tests passed individually with `-race -count=3`; scheduling covers defaults, overlap, each stage failing, sequential mode, and budgets 1/2. - `go vet ./optools` - `node --test .github/ci/change-scope.test.cjs` - `bash -n optools/run_ut.sh` and `git diff --check` - Independent GPT-6 medium review: no blocking or medium findings. - Real heavy/plan runs passed with the repository CGo wrapper, `-race`, `matrixone_test`, and the unchanged three-slot budget. The warm sequential baseline took 303.11s; overlap took 229.19s: 73.92s (24.4%) less elapsed time for this local stage sample. Both runs had exactly the same 16,013 test/subtest start events and terminal statuses, with zero failures. - A first cold baseline took 440.04s and is excluded from the claimed gain. Measurement order was cold sequential, warm overlap, then warm sequential. This is one local macOS comparison, not a controlled Linux CI benchmark. The heavy/plan scheduler was invoked directly, with existing native artifacts verified by the official wrapper; checkout, native prerequisite rebuild, and full-suite setup were excluded equally from both measurements. External-service eligibility remains environment-dependent. - The historical CI trace suggests roughly 2m20s of potential overlap; this is not a measured CI saving. Target Linux CI still needs to confirm peak memory and net elapsed time. This repository uses `pull_request_target`, so this PR still uses the base workflow's four-job caller until merged. Its heavy-plan job does execute the updated scheduler from the PR head; the single-runner caller is covered by the workflow contract test.
…8632) ## What type of PR is this? - [x] Improvement - [x] Test and CI ## Which issue(s) this PR fixes: Related to matrixorigin#28419 and matrixorigin#28538. ## What this PR does / why we need it: Keep the complete race-UT suite on one runner and reuse engine capacity to run plan tests while the remaining resource-heavy tests finish. A historical single-runner trace left engine slots idle from 06:22:22 to 06:26:04, then ran plan for about another 2m20s. With the default budget of three, execution changes from `engine(2) + resource(1)` to `plan(1) + resource(1)` after engine exits. Plan compilation retains `-p1`. `UT_OVERLAP_PLAN=1` enables this by default; `0` provides the sequential baseline. Budgets of one/two and paths without a concurrent engine helper keep sequential execution. The CI caller restores `ut_sharded: false`, undoing matrixorigin#28575's multi-runner topology; that restoration itself is not counted as a speedup against the previous single-runner baseline. The parent keeps the foreground PID and independent command metadata while joining engine. Engine failure remains a failure and does not skip plan. Report merging waits for the heavy writer to exit, avoiding data loss from renaming an open output file. Cancellation signals all owned groups before bounded waits and merges stopped writers only. No test cases, data sizes, assertions, race flags, timeouts, cluster admission, or coverage jobs are weakened. The logservice companion experiment was removed: package elapsed time alone did not demonstrate critical-path savings. ### Validation - `go test -race ./optools -count=1` - Both new scheduling/cancellation tests passed individually with `-race -count=3`; scheduling covers defaults, overlap, each stage failing, sequential mode, and budgets 1/2. - `go vet ./optools` - `node --test .github/ci/change-scope.test.cjs` - `bash -n optools/run_ut.sh` and `git diff --check` - Independent GPT-6 medium review: no blocking or medium findings. - Real heavy/plan runs passed with the repository CGo wrapper, `-race`, `matrixone_test`, and the unchanged three-slot budget. The warm sequential baseline took 303.11s; overlap took 229.19s: 73.92s (24.4%) less elapsed time for this local stage sample. Both runs had exactly the same 16,013 test/subtest start events and terminal statuses, with zero failures. - A first cold baseline took 440.04s and is excluded from the claimed gain. Measurement order was cold sequential, warm overlap, then warm sequential. This is one local macOS comparison, not a controlled Linux CI benchmark. The heavy/plan scheduler was invoked directly, with existing native artifacts verified by the official wrapper; checkout, native prerequisite rebuild, and full-suite setup were excluded equally from both measurements. External-service eligibility remains environment-dependent. - The historical CI trace suggests roughly 2m20s of potential overlap; this is not a measured CI saving. Target Linux CI still needs to confirm peak memory and net elapsed time. This repository uses `pull_request_target`, so this PR still uses the base workflow's four-job caller until merged. Its heavy-plan job does execute the updated scheduler from the PR head; the single-runner caller is covered by the workflow contract test.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #28419 and #28538.
What this PR does / why we need it:
Keep the complete race-UT suite on one runner and reuse engine capacity to run plan tests while the remaining resource-heavy tests finish. A historical single-runner trace left engine slots idle from 06:22:22 to 06:26:04, then ran plan for about another 2m20s.
With the default budget of three, execution changes from
engine(2) + resource(1)toplan(1) + resource(1)after engine exits. Plan compilation retains-p1.UT_OVERLAP_PLAN=1enables this by default;0provides the sequential baseline. Budgets of one/two and paths without a concurrent engine helper keep sequential execution. The CI caller restoresut_sharded: false, undoing #28575's multi-runner topology; that restoration itself is not counted as a speedup against the previous single-runner baseline.The parent keeps the foreground PID and independent command metadata while joining engine. Engine failure remains a failure and does not skip plan. Report merging waits for the heavy writer to exit, avoiding data loss from renaming an open output file. Cancellation signals all owned groups before bounded waits and merges stopped writers only.
No test cases, data sizes, assertions, race flags, timeouts, cluster admission, or coverage jobs are weakened. The logservice companion experiment was removed: package elapsed time alone did not demonstrate critical-path savings.
Validation
go test -race ./optools -count=1-race -count=3; scheduling covers defaults, overlap, each stage failing, sequential mode, and budgets 1/2.go vet ./optoolsnode --test .github/ci/change-scope.test.cjsbash -n optools/run_ut.shandgit diff --check-race,matrixone_test, and the unchanged three-slot budget. The warm sequential baseline took 303.11s; overlap took 229.19s: 73.92s (24.4%) less elapsed time for this local stage sample. Both runs had exactly the same 16,013 test/subtest start events and terminal statuses, with zero failures.This repository uses
pull_request_target, so this PR still uses the base workflow's four-job caller until merged. Its heavy-plan job does execute the updated scheduler from the PR head; the single-runner caller is covered by the workflow contract test.