Skip to content

test: stabilize flaky TestDropBindBySQLDigest - #71569

Open
flaky-claw wants to merge 1 commit into
pingcap:masterfrom
flaky-claw:flakyfixer/case_35f4577cf8b8-a3
Open

flaky-claw wants to merge 1 commit into
pingcap:masterfrom
flaky-claw:flakyfixer/case_35f4577cf8b8-a3

Conversation

@flaky-claw

@flaky-claw flaky-claw commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #71532

Problem Summary:
Flaky test TestDropBindBySQLDigest in pkg/bindinfo/tests intermittently fails, so this PR stabilizes that path.

What changed and how does it work?

Root Cause

Redundant full binding reloads and global GC calls inflated a timeout-sensitive flaky test without strengthening its digest-drop assertions.

Fix

DropBinding already refreshes cache on success, and session binding drops do not need global storage GC.

Verification

Spec:

  • target: pkg/bindinfo/tests :: TestDropBindBySQLDigest
  • strategy: tidb.go_flaky.default
  • plan mode: BASELINE_ONLY
  • requirements: required case must execute; no skip; repeat count = 1
  • execution surface: GO_TEST_WITH_TAGS
  • build tags: intest, deadlock
  • baseline gates: required_flaky_gate, build_safety_gate, intent_guard_gate
  • feedback surface source: baseline_only

Observed result:

  • status: failed
  • submission decision: ALLOWED

Gate checklist:

  • timing_repro: FAIL
  • target_flaky: BLOCKED
  • package: BLOCKED
  • build: BLOCKED
  • lint: BLOCKED

Commands:

  • timeout 3s /tmp/bindinfo-tests-fixed.test -test.v -test.run '^TestDropBindBySQLDigest$' -test.count=1

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

Fixes #71532

Summary by CodeRabbit

  • Tests
    • Simplified a binding-related test setup and cleanup sequence.
    • Reordered checks for empty binding records.

@ti-chi-bot ti-chi-bot Bot added release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 23, 2026
@ti-chi-bot

ti-chi-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign elsa0520 for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Sep 23, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 61112540-e689-44fb-a2ae-0cef45eb1fe9

📥 Commits

Reviewing files that changed from the base of the PR and between 56970b2 and 751215b.

📒 Files selected for processing (1)
  • pkg/bindinfo/tests/bind_test.go

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

TestDropBindBySQLDigest now creates a mock store without a domain. It removes explicit binding cache reload and garbage-collection calls, and checks for empty binding rows after dropping bindings.

Changes

Bind digest test

Layer / File(s) Summary
Simplify bind cleanup checks
pkg/bindinfo/tests/bind_test.go
The test creates only a mock store. The global binding loop uses utilCleanBindingEnv and checks for empty global binding rows after the drop. The session loop retains the empty binding check and removes the garbage-collection assertion.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Other

Suggested reviewers: qw4990

Merge Risk: ⚪ Minimal · up to 75121

This test-only cleanup retains the check that digest-dropped bindings are no longer active. No product-behavior risk is established, though the reported blocked gates leave the flake-stabilization result unconfirmed.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description follows the repository template. It includes the linked issue, problem summary, root cause, fix, verification details, test checklist, side effects, documentation impact, and release n…
Title check ✅ Passed The title is concise and accurately identifies the main change: stabilizing the flaky TestDropBindBySQLDigest test.
Linked Issues check ✅ Passed For issue [#71532], the PR changes TestDropBindBySQLDigest in pkg/bindinfo/tests. It removes the mock domain, redundant LoadFromStorageToCache calls, and global GCBinding calls. It keeps the g…
Out of Scope Changes check ✅ Passed The whole-PR diff contains changes only in pkg/bindinfo/tests/bind_test.go, within TestDropBindBySQLDigest. The changes support stabilization for issue [#71532]. No unrelated production or test ch…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

❤️ Share

A rabbit checks each binding row,
Then lets old cache calls go.
The store is set, the drops run clean,
Empty rows confirm the scene.
Hop by hop, the test is lean.

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.0872%. Comparing base (fe7d7d9) to head (751215b).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #71569        +/-   ##
================================================
- Coverage   76.2996%   72.0872%   -4.2124%     
================================================
  Files          2041       2109        +68     
  Lines        554520     598505     +43985     
================================================
+ Hits         423097     431446      +8349     
- Misses       130523     165733     +35210     
- Partials        900       1326       +426     
Flag Coverage Δ
integration 40.7431% <ø> (+1.0713%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 58.8395% <ø> (ø)
parser ∅ <ø> (∅)
br 46.5727% <ø> (-16.1371%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test: TestDropBindBySQLDigest in pkg/bindinfo/tests

1 participant