Repository navigation
test(embed): isolate shared test-cluster lifecycles (#26522) - #26752
Conversation
7d754ad to
9cb7a17
Compare
9cb7a17 to
2351e16
Compare
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? |
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.
Deep-reviewed the complete diff and latest head 8e0b8f6. No blocking findings.
The lifecycle contract is coherent:
- the first complete test cluster owns the runner-wide flock for its full lifetime;
- an implicit same-process second cluster fails fast;
- only explicit multi-cluster tests may add reentrant leases;
- the final lease releases the flock;
- startup/close failures retain the cleanup owner and admission until cleanup actually succeeds.
The three bespoke issues regressions are moved to a separate package without weakening their assertions, the shared join-spill helpers preserve behavior, and the new package is removed from the parallel race scope and run in the existing serial scope. This appropriately fixes the test-cluster resource-concurrency problem without changing or masking the separate production HAKeeper command-progress contract tracked by #26566.
Fresh validation on this head:
- diff check and bash -n optools/run_ut.sh;
- package-list and serial-scope resolution;
- build/vet for all affected packages;
- clusteradmission unit tests and race x20;
- focused embed admission/rollback/cleanup tests;
- TestMultiClusterCanWork and TestBaseClusterCanWorkWithNewCluster.
All passed. CI is also green.
Merge Queue Status
This pull request spent 24 seconds in the queue, including 3 seconds running CI. Required conditions to merge
|
…) (matrixorigin#26752) The post-merge recurrence was not only cross-process parallelism. In the serial Ubuntu/x86 stage, `pkg/tests/issues` retained its 3-CN shared base cluster and a following test started a bespoke 1-CN cluster. Admission was reentrant in one test binary, so the runner-wide lock did not see six live services. This PR makes complete test-cluster lifetime exclusive by default, without repeatedly stopping and rebuilding the issues package's shared base: - Reject an implicit second complete cluster in one test process. Only tests whose assertion genuinely needs multiple complete clusters use `WithConcurrentTestClusters`. - Move the three bespoke-configuration issue regressions to `pkg/tests/issues/isolated`, a separate test binary. It has no shared base cluster. - Put that package in `run_ut.sh`'s existing serial race-test scope, so it is explicitly scheduled as an embedded-cluster workload. - Extract the shared join-spill SQL helpers into an `issues/internal` package; the original shared-base regression and the isolated regressions use the same implementation. No production HAKeeper timeout, heartbeat, RPC, or retry behavior changes. matrixorigin#26566 remains the separate production command-progress design issue. Validation: - [x] `go test -count=1 ./pkg/testutil/clusteradmission` - [x] `.agents/skills/mo-dev/scripts/mo-cgo-test -run '^$' ./pkg/embed ./pkg/tests/issues ./pkg/tests/issues/isolated ./pkg/tests/service ./pkg/tests/issues/internal/joinspill` - [x] `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^(TestHashBuildSharedBudgetRecoverySQL|TestIssue25782BroadcastHashBuildFailsClosedUnderHardBudget|TestSpeedupAbortAllTxn)$' ./pkg/tests/issues/isolated` (41.4s) - [x] `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^(TestAuthenticatedTestsReuseBaseCluster|TestIssue25526PreparedUpdateJoinSecondExecute|TestIssue25753PreparedNumericProtocolLifecycle|TestIssue26408JoinSpillSQLRegression)$' ./pkg/tests/issues` (18.3s) - [x] `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^TestIssue26568ExplainMultiCNHashJoin$' ./pkg/tests/issues` - [x] `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=120s -run '^TestStartTestClusterReturnsCleanupOwnerOnRollbackFailure$' ./pkg/embed` - [x] `bash -n optools/run_ut.sh` and the serial package-list resolution Self-review: - Scope is limited to embedded test-cluster admission and test placement. No production code path changed. - The isolated regressions retain their original test names and assertions; only their process lifetime changed. - [x] `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^(TestClusterAdmissionCoversFullLifecycle|TestDoStartLockedErrorPaths|TestClusterStartRollbackClosesPartiallyStartedServices|TestStartTestClusterReturnsCleanupOwnerOnRollbackFailure)$' ./pkg/embed` - [x] Recompiled `./pkg/tests/issues`, `./pkg/tests/issues/isolated`, and `./pkg/tests/issues/internal/joinspill`. - [ ] Fresh Ubuntu/x86 CI is required after `28a824a78d`; the preceding run failed only in PR test scaffolding (four `pkg/embed` assertions and one unused alias), not with the matrixorigin#26522 runtime signature. No automatic retry was performed. Approved by: @XuPeng-SH
…) (matrixorigin#26752) The post-merge recurrence was not only cross-process parallelism. In the serial Ubuntu/x86 stage, `pkg/tests/issues` retained its 3-CN shared base cluster and a following test started a bespoke 1-CN cluster. Admission was reentrant in one test binary, so the runner-wide lock did not see six live services. This PR makes complete test-cluster lifetime exclusive by default, without repeatedly stopping and rebuilding the issues package's shared base: - Reject an implicit second complete cluster in one test process. Only tests whose assertion genuinely needs multiple complete clusters use `WithConcurrentTestClusters`. - Move the three bespoke-configuration issue regressions to `pkg/tests/issues/isolated`, a separate test binary. It has no shared base cluster. - Put that package in `run_ut.sh`'s existing serial race-test scope, so it is explicitly scheduled as an embedded-cluster workload. - Extract the shared join-spill SQL helpers into an `issues/internal` package; the original shared-base regression and the isolated regressions use the same implementation. No production HAKeeper timeout, heartbeat, RPC, or retry behavior changes. matrixorigin#26566 remains the separate production command-progress design issue. Validation: - [x] `go test -count=1 ./pkg/testutil/clusteradmission` - [x] `.agents/skills/mo-dev/scripts/mo-cgo-test -run '^$' ./pkg/embed ./pkg/tests/issues ./pkg/tests/issues/isolated ./pkg/tests/service ./pkg/tests/issues/internal/joinspill` - [x] `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^(TestHashBuildSharedBudgetRecoverySQL|TestIssue25782BroadcastHashBuildFailsClosedUnderHardBudget|TestSpeedupAbortAllTxn)$' ./pkg/tests/issues/isolated` (41.4s) - [x] `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^(TestAuthenticatedTestsReuseBaseCluster|TestIssue25526PreparedUpdateJoinSecondExecute|TestIssue25753PreparedNumericProtocolLifecycle|TestIssue26408JoinSpillSQLRegression)$' ./pkg/tests/issues` (18.3s) - [x] `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^TestIssue26568ExplainMultiCNHashJoin$' ./pkg/tests/issues` - [x] `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=120s -run '^TestStartTestClusterReturnsCleanupOwnerOnRollbackFailure$' ./pkg/embed` - [x] `bash -n optools/run_ut.sh` and the serial package-list resolution Self-review: - Scope is limited to embedded test-cluster admission and test placement. No production code path changed. - The isolated regressions retain their original test names and assertions; only their process lifetime changed. - [x] `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^(TestClusterAdmissionCoversFullLifecycle|TestDoStartLockedErrorPaths|TestClusterStartRollbackClosesPartiallyStartedServices|TestStartTestClusterReturnsCleanupOwnerOnRollbackFailure)$' ./pkg/embed` - [x] Recompiled `./pkg/tests/issues`, `./pkg/tests/issues/isolated`, and `./pkg/tests/issues/internal/joinspill`. - [ ] Fresh Ubuntu/x86 CI is required after `28a824a78d`; the preceding run failed only in PR test scaffolding (four `pkg/embed` assertions and one unused alias), not with the matrixorigin#26522 runtime signature. No automatic retry was performed. Approved by: @XuPeng-SH
…) (matrixorigin#26752) The post-merge recurrence was not only cross-process parallelism. In the serial Ubuntu/x86 stage, `pkg/tests/issues` retained its 3-CN shared base cluster and a following test started a bespoke 1-CN cluster. Admission was reentrant in one test binary, so the runner-wide lock did not see six live services. This PR makes complete test-cluster lifetime exclusive by default, without repeatedly stopping and rebuilding the issues package's shared base: - Reject an implicit second complete cluster in one test process. Only tests whose assertion genuinely needs multiple complete clusters use `WithConcurrentTestClusters`. - Move the three bespoke-configuration issue regressions to `pkg/tests/issues/isolated`, a separate test binary. It has no shared base cluster. - Put that package in `run_ut.sh`'s existing serial race-test scope, so it is explicitly scheduled as an embedded-cluster workload. - Extract the shared join-spill SQL helpers into an `issues/internal` package; the original shared-base regression and the isolated regressions use the same implementation. No production HAKeeper timeout, heartbeat, RPC, or retry behavior changes. matrixorigin#26566 remains the separate production command-progress design issue. Validation: - [x] `go test -count=1 ./pkg/testutil/clusteradmission` - [x] `.agents/skills/mo-dev/scripts/mo-cgo-test -run '^$' ./pkg/embed ./pkg/tests/issues ./pkg/tests/issues/isolated ./pkg/tests/service ./pkg/tests/issues/internal/joinspill` - [x] `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^(TestHashBuildSharedBudgetRecoverySQL|TestIssue25782BroadcastHashBuildFailsClosedUnderHardBudget|TestSpeedupAbortAllTxn)$' ./pkg/tests/issues/isolated` (41.4s) - [x] `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^(TestAuthenticatedTestsReuseBaseCluster|TestIssue25526PreparedUpdateJoinSecondExecute|TestIssue25753PreparedNumericProtocolLifecycle|TestIssue26408JoinSpillSQLRegression)$' ./pkg/tests/issues` (18.3s) - [x] `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^TestIssue26568ExplainMultiCNHashJoin$' ./pkg/tests/issues` - [x] `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=120s -run '^TestStartTestClusterReturnsCleanupOwnerOnRollbackFailure$' ./pkg/embed` - [x] `bash -n optools/run_ut.sh` and the serial package-list resolution Self-review: - Scope is limited to embedded test-cluster admission and test placement. No production code path changed. - The isolated regressions retain their original test names and assertions; only their process lifetime changed. - [x] `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^(TestClusterAdmissionCoversFullLifecycle|TestDoStartLockedErrorPaths|TestClusterStartRollbackClosesPartiallyStartedServices|TestStartTestClusterReturnsCleanupOwnerOnRollbackFailure)$' ./pkg/embed` - [x] Recompiled `./pkg/tests/issues`, `./pkg/tests/issues/isolated`, and `./pkg/tests/issues/internal/joinspill`. - [ ] Fresh Ubuntu/x86 CI is required after `28a824a78d`; the preceding run failed only in PR test scaffolding (four `pkg/embed` assertions and one unused alias), not with the matrixorigin#26522 runtime signature. No automatic retry was performed. Approved by: @XuPeng-SH
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #26522
What this PR does / why we need it:
The post-merge recurrence was not only cross-process parallelism. In the serial Ubuntu/x86 stage,
pkg/tests/issuesretained its 3-CN shared base cluster and a following test started a bespoke 1-CN cluster. Admission was reentrant in one test binary, so the runner-wide lock did not see six live services.This PR makes complete test-cluster lifetime exclusive by default, without repeatedly stopping and rebuilding the issues package's shared base:
WithConcurrentTestClusters.pkg/tests/issues/isolated, a separate test binary. It has no shared base cluster.run_ut.sh's existing serial race-test scope, so it is explicitly scheduled as an embedded-cluster workload.issues/internalpackage; the original shared-base regression and the isolated regressions use the same implementation.No production HAKeeper timeout, heartbeat, RPC, or retry behavior changes. #26566 remains the separate production command-progress design issue.
Validation:
go test -count=1 ./pkg/testutil/clusteradmission.agents/skills/mo-dev/scripts/mo-cgo-test -run '^$' ./pkg/embed ./pkg/tests/issues ./pkg/tests/issues/isolated ./pkg/tests/service ./pkg/tests/issues/internal/joinspill.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^(TestHashBuildSharedBudgetRecoverySQL|TestIssue25782BroadcastHashBuildFailsClosedUnderHardBudget|TestSpeedupAbortAllTxn)$' ./pkg/tests/issues/isolated(41.4s).agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^(TestAuthenticatedTestsReuseBaseCluster|TestIssue25526PreparedUpdateJoinSecondExecute|TestIssue25753PreparedNumericProtocolLifecycle|TestIssue26408JoinSpillSQLRegression)$' ./pkg/tests/issues(18.3s).agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^TestIssue26568ExplainMultiCNHashJoin$' ./pkg/tests/issues.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=120s -run '^TestStartTestClusterReturnsCleanupOwnerOnRollbackFailure$' ./pkg/embedbash -n optools/run_ut.shand the serial package-list resolutionSelf-review:
.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^(TestClusterAdmissionCoversFullLifecycle|TestDoStartLockedErrorPaths|TestClusterStartRollbackClosesPartiallyStartedServices|TestStartTestClusterReturnsCleanupOwnerOnRollbackFailure)$' ./pkg/embed./pkg/tests/issues,./pkg/tests/issues/isolated, and./pkg/tests/issues/internal/joinspill.28a824a78d; the preceding run failed only in PR test scaffolding (fourpkg/embedassertions and one unused alias), not with the [Bug]: Embedded-cluster UTs still lose HAKeeper connections under Ubuntu/x86 load #26522 runtime signature. No automatic retry was performed.