Repository navigation
test: stabilize task creation after CN failover - #33296
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: bc852db8898cfb78120a770f890b616591009ebf
Assessment: approve
The test now retries the survivor's follow-up task creation only for a direct lock-table binding error, within the original deadline. The underlying TN rejects that error before commit, while ambiguous and joined client errors are returned without retry. The existing expiration, survivor ownership, exact-row and no-replay assertions remain in place.
Model: gpt-6.1-terra / max
Session: 01a21559-2c14-7273-a4d2-83e9387fd8ce · slot 2 · generation 5
Validation:
-
Preflight passed, and native prerequisites were built from inputs matching the frozen source: checks/1795678455267615651-2.json, checks/1795678517401859578-2.json, native-build.log and native-source-check.log.
-
The selected service tests passed with -race -count=1: TestCreateTaskAfterFailover and TestTaskSchedulerExpiresLostRunnerWithoutReplay, including its two-CN failover. The log shows all four retry subtests and the integration test ran: checks/1795678774659663592-2.json and service-tests.log.
-
git diff --check passed: checks/1795678556320654901-2.json and diff-check.log.
Limitations:
- The two-CN run did not demonstrate that it encountered error 20702; the retry and non-retry cases were exercised by deterministic injected errors. The author's reported full service race suite was not independently rerun, and the frozen CI UT job was queued.
What type of PR is this?
Which issue(s) this PR fixes:
Related issue #32745 (main flaky CI/UT tracker).
What this PR does / why we need it:
TestTaskSchedulerExpiresLostRunnerWithoutReplaysometimes fails when the surviving CN creates a follow-up task. The old task has expired, but the follow-up INSERT can still hit a stale lock-table binding and roll back with MySQL error 20702. This occurred on cleanmainand on #33010.Retry the survivor's follow-up INSERT under the original test deadline only after the explicit driver response that rolls back the transaction. Keep the exact-one-row, survivor ownership, and one-execution assertions. Preserve ambiguous write failures, since task metadata IDs are not unique.
Validation
pkg/tests/servicerace suite passed, including the two-CN failover and no-replay assertions../pkg/tests/service. Formatting, diff checks, err-check, molint and golangci-lint passed with zero lint issues.