pkg/server: stabilize flaky TestIssue54335 (#67888)#70014
Conversation
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
📝 WalkthroughWalkthrough
ChangesTestIssue54335 stabilization
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/server/conn_test.go`:
- Around line 2354-2362: Resolve the conflict in the test setup by keeping the
session.MustExec calls with t and se, removing all conflict markers, and
deleting the obsolete tk.MustExec branch and references in the affected test.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 71f482de-5730-4ed1-8e68-0c141250cfc3
📒 Files selected for processing (1)
pkg/server/conn_test.go
| <<<<<<< HEAD | ||
| tk.MustExec(str) | ||
| for i := 0; i < 14; i++ { | ||
| tk.MustExec("insert into testTable2 select * from testTable2") | ||
| ======= | ||
| session.MustExec(t, se, str) | ||
| for range 14 { | ||
| session.MustExec(t, se, "insert into testTable2 select * from testTable2") | ||
| >>>>>>> 56490d622d7 (pkg/server: stabilize flaky TestIssue54335 (#67888)) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Resolve the merge conflict before merging.
The checked-in test still contains <<<<<<<, =======, and >>>>>>> markers. It also retains tk.MustExec, although tk is no longer declared. Keep the session.MustExec branch and remove the conflict markers and obsolete tk calls.
Proposed fix
-<<<<<<< HEAD
- tk.MustExec(str)
- for i := 0; i < 14; i++ {
- tk.MustExec("insert into testTable2 select * from testTable2")
-=======
session.MustExec(t, se, str)
for range 14 {
session.MustExec(t, se, "insert into testTable2 select * from testTable2")
->>>>>>> 56490d622d7 (pkg/server: stabilize flaky TestIssue54335 (`#67888`))📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <<<<<<< HEAD | |
| tk.MustExec(str) | |
| for i := 0; i < 14; i++ { | |
| tk.MustExec("insert into testTable2 select * from testTable2") | |
| ======= | |
| session.MustExec(t, se, str) | |
| for range 14 { | |
| session.MustExec(t, se, "insert into testTable2 select * from testTable2") | |
| >>>>>>> 56490d622d7 (pkg/server: stabilize flaky TestIssue54335 (#67888)) | |
| session.MustExec(t, se, str) | |
| for range 14 { | |
| session.MustExec(t, se, "insert into testTable2 select * from testTable2") | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@pkg/server/conn_test.go` around lines 2354 - 2362, Resolve the conflict in
the test setup by keeping the session.MustExec calls with t and se, removing all
conflict markers, and deleting the obsolete tk.MustExec branch and references in
the affected test.
|
@ti-chi-bot: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
This is an automated cherry-pick of #67888
What problem does this PR solve?
Issue Number: close #67558
Problem Summary:
Flaky test
TestIssue54335inpkg/serverintermittently fails, so this PR stabilizes that path.What changed and how does it work?
Root Cause
TestIssue54335 constructed a client connection with nil
pktand relied on failpoint behavior; when the query reached result writing,writePacketdereferenced nil and panicked.Fix
Initializing
cc.pktin the flaky test removes the nil dereference window without changing product behavior.Verification
Spec:
pkg/server :: TestIssue54335tidb.go_flaky.defaultBASELINE_ONLYObserved result:
Gate checklist:
Commands:
go test -json ./pkg/server -run '^TestIssue54335$' -count=1go test -json ./pkg/server -count=1make buildCheck List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Fixes #67558
Summary by CodeRabbit