Repository navigation
fix(embed): preserve base cluster startup errors - #26203
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.
Blocking finding:
[P1] Make all RunBaseClusterTests callers observe the cached startup error. onceCluster.run now returns the stored initialization error before invoking the callback, but this PR updates only TestDataBranchDiffAsFile. Of 45 RunBaseClusterTests occurrences in the tree (including the helper definition), only 3 calls are wrapped with require.NoError; roughly 41 test/benchmark call sites still discard the return value. If the shared cluster fails to initialize, those callers will skip their entire test callback and still report success. Before this change a later call at least panicked, so the suite could not go green without running its assertions. Please update every caller to fail on the returned error, or change the helper API to report the error through testing.TB/another non-ignorable mechanism.
The focused regression test, build, vet, DML compile check, diff check, and current CI all pass on 6c5531e; this issue concerns the failure path that normal green CI does not exercise.
|
Addressed in
Verified with all five affected packages compiled, vet across those packages, |
Merge Queue Status
This pull request spent 2 hours 1 minute 13 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonThe merge conditions cannot be satisfied due to failing checks Failing checks:
HintYou may have to fix your CI before adding the pull request to the queue again. Requeued — the merge queue status continues in this comment ↓. |
Merge Queue Status
This pull request spent 1 hour 45 minutes 38 seconds in the queue, with no time running CI. ReasonThe pull request can't be updated
HintYou should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #25929
What this PR does / why we need it:
RunBaseClusterTestsstored the base cluster globally but kept its initialization error in a call-local variable. If the firstNewClusterorStartattempt failed,sync.Oncewas permanently consumed. A later call then observed a fresh nil error and dereferenced the still-nil global cluster, replacing the original startup failure with an unrelated nil-pointer panic.This change:
torb) so startup errors are fatal and cannot be discarded by callers;RunBaseClusterTeststest and benchmark caller to the non-ignorable API;The focused regression test invokes a failing initializer twice and verifies that initialization runs once, both calls report the original error, and the test callback is never invoked.
Validation:
make buildgo vet ./pkg/embed ./pkg/tests/ddl ./pkg/tests/issues ./pkg/tests/dml ./pkg/tests/txnexecutorgo test ... -run "^$" -count=1go test -v ./pkg/embed -run "^TestOnceClusterReportsInitializationError$" -count=1go test -v ./pkg/embed -run "^TestBaseClusterOnlyStartOnce$" -count=1go test -v ./pkg/tests/dml -run "^TestDataBranchDiffAsFile$" -count=1go test ./pkg/tests/issues -run '^$' -count=1andgo vet ./pkg/tests/issuesmainmerge, migrated the newly addedissue_25986_test.gocaller to the required test-reporter API