Skip to content

pkg/ddl/tests/tiflash: stabilize flaky TestTiFlashAvailableAfterDownOneStore#67821

Merged
ti-chi-bot[bot] merged 1 commit into
pingcap:masterfrom
flaky-claw:flakyfixer/case_b5441d7e9239-a6
May 14, 2026
Merged

pkg/ddl/tests/tiflash: stabilize flaky TestTiFlashAvailableAfterDownOneStore#67821
ti-chi-bot[bot] merged 1 commit into
pingcap:masterfrom
flaky-claw:flakyfixer/case_b5441d7e9239-a6

Conversation

@flaky-claw

@flaky-claw flaky-claw commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #67562

Problem Summary:
Flaky test TestTiFlashAvailableAfterDownOneStore in pkg/ddl/tests/tiflash intermittently fails, so this PR stabilizes that path.

What changed and how does it work?

Root Cause

TEST_ISSUE; this case used testkit.NewTestKit, so the required plain go test command failed on the intest constructor guard before reaching the TiFlash availability assertion

Fix

switching only this case to NewTestKitWithSession(...NewSession(...)) removes the invalid validator-surface dependency while leaving the TiFlash/failpoint assertion path intact

Verification

Spec:

  • target: pkg/ddl/tests/tiflash :: TestTiFlashAvailableAfterDownOneStore
  • strategy: tidb.go_flaky.default
  • plan mode: BASELINE_ONLY
  • requirements: required case must execute; no skip; repeat count = 1
  • baseline gates: required_flaky_gate, build_safety_gate, intent_guard_gate

Observed result:

  • status: passed
  • required case executed: yes
  • submission decision: ALLOWED
  • scope debt present: yes

Gate checklist:

  • Required flaky gate: PASS
  • Build safety gate: PASS
  • Intent guard gate: PASS
  • Repo-wide advisory gate: SKIPPED
  • Feedback specific gate: SKIPPED

Commands:

  • go test -json ./pkg/ddl/tests/tiflash -run '^TestTiFlashAvailableAfterDownOneStore$' -count=1
  • go test -json ./pkg/ddl/tests/tiflash -count=1
  • make build

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 #67562

Summary by CodeRabbit

  • Tests
    • Improved session handling in TiFlash DDL tests to stabilize test execution, reduce flakiness, and better manage test resources, leading to more reliable test outcomes and smoother CI runs.

@ti-chi-bot ti-chi-bot Bot added do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. labels Apr 16, 2026
@pantheon-ai

pantheon-ai Bot commented Apr 16, 2026

Copy link
Copy Markdown

@flaky-claw I've received your pull request and will start the review. I'll conduct a thorough review covering code quality, potential issues, and implementation details.

⏳ This process typically takes 10-30 minutes depending on the complexity of the changes.

ℹ️ Learn more details on Pantheon AI.

@ti-chi-bot ti-chi-bot Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 16, 2026
@tiprow

tiprow Bot commented Apr 16, 2026

Copy link
Copy Markdown

Hi @flaky-claw. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Details

Instructions 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.

@coderabbitai

coderabbitai Bot commented Apr 16, 2026

Copy link
Copy Markdown

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2e3d05cc-6036-4934-bf6f-2079f61485c8

📥 Commits

Reviewing files that changed from the base of the PR and between 2a65c36 and 6ba7af9.

📒 Files selected for processing (1)
  • pkg/ddl/tests/tiflash/ddl_tiflash_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/ddl/tests/tiflash/ddl_tiflash_test.go

📝 Walkthrough

Walkthrough

The TiFlash DDL test TestTiFlashAvailableAfterDownOneStore now creates an explicit session via testkit.NewSession and passes it into testkit.NewTestKitWithSession, changing the test's session lifecycle for subsequent tk.MustExec calls.

Changes

Test Session Initialization

Layer / File(s) Summary
Test Setup
pkg/ddl/tests/tiflash/ddl_tiflash_test.go
Replaces testkit.NewTestKit(t, s.store) with testkit.NewTestKitWithSession(t, s.store, testkit.NewSession(t, s.store)), making the test use an explicit session object.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • wjhuang2016
  • expxiaoli
  • tiancaiamao

Poem

🐰 A quiet hop in testland's glen,
I made a session once again.
NewSession handed to TestKit's lap,
No more races, no more flap.
🥕 Tests now nap, content—hap-hap!

🚥 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main change: stabilizing a flaky test in the pkg/ddl/tests/tiflash package by naming the exact test.
Description check ✅ Passed The description includes a proper issue reference (close #67562), explains the problem (flaky test due to testkit constructor guard), describes the fix (switching to NewTestKitWithSession), and provides verification details with test commands.
Linked Issues check ✅ Passed The code changes directly address the linked issue #67562 by stabilizing the flaky TestTiFlashAvailableAfterDownOneStore test through switching from NewTestKit to NewTestKitWithSession, eliminating the constructor guard failure.
Out of Scope Changes check ✅ Passed All changes are in-scope: only one line modification in the test file to change the testkit initialization method, directly addressing the flaky test stabilization objective from issue #67562.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.1)

Command failed


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

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

@codecov

codecov Bot commented Apr 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.2787%. Comparing base (84548db) to head (6ba7af9).
⚠️ Report is 34 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #67821        +/-   ##
================================================
+ Coverage   77.7307%   78.2787%   +0.5480%     
================================================
  Files          1990       2022        +32     
  Lines        551899     570114     +18215     
================================================
+ Hits         428995     446278     +17283     
+ Misses       121984     121283       -701     
- Partials        920       2553      +1633     
Flag Coverage Δ
integration 48.0208% <ø> (+8.2190%) ⬆️

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

Components Coverage Δ
dumpling 60.4888% <ø> (ø)
parser ∅ <ø> (∅)
br 66.0953% <ø> (+3.0018%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yinsustart
yinsustart requested a review from bb7133 April 17, 2026 06:16
@yinsustart

Copy link
Copy Markdown

/retest

@tiprow

tiprow Bot commented Apr 22, 2026

Copy link
Copy Markdown

@yinsustart: PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test.

Details

In response to this:

/retest

Instructions 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.

@bb7133 bb7133 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot Bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 7, 2026
@ti-chi-bot

ti-chi-bot Bot commented May 7, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bb7133, tiancaiamao

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

The pull request process is described 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

@ti-chi-bot ti-chi-bot Bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 7, 2026
@ti-chi-bot

ti-chi-bot Bot commented May 7, 2026

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2026-05-07 05:56:20.351877038 +0000 UTC m=+333653.225227000: ☑️ agreed by bb7133.
  • 2026-05-07 06:54:46.206062244 +0000 UTC m=+337159.079412216: ☑️ agreed by tiancaiamao.

@tiprow

tiprow Bot commented May 7, 2026

Copy link
Copy Markdown

@flaky-claw: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
fast_test_tiprow 2a65c36 link true /test fast_test_tiprow

Full PR test history. Your PR dashboard.

Details

Instructions 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.

@yinsustart
yinsustart force-pushed the flakyfixer/case_b5441d7e9239-a6 branch from 2a65c36 to 6ba7af9 Compare May 8, 2026 11:42
@flaky-claw

Copy link
Copy Markdown
Contributor Author

/retest

@tiprow

tiprow Bot commented May 9, 2026

Copy link
Copy Markdown

@flaky-claw: PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test.

Details

In response to this:

/retest

Instructions 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.

@flaky-claw

Copy link
Copy Markdown
Contributor Author

/test pull-unit-test-ddlv1

@tiprow

tiprow Bot commented May 9, 2026

Copy link
Copy Markdown

@flaky-claw: PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test.

Details

In response to this:

/test pull-unit-test-ddlv1

Instructions 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.

@yinsustart

Copy link
Copy Markdown

/retest

@tiprow

tiprow Bot commented May 10, 2026

Copy link
Copy Markdown

@yinsustart: PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test.

Details

In response to this:

/retest

Instructions 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.

@yinsustart

Copy link
Copy Markdown

/test pull-unit-test-ddlv1

@tiprow

tiprow Bot commented May 10, 2026

Copy link
Copy Markdown

@yinsustart: PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test.

Details

In response to this:

/test pull-unit-test-ddlv1

Instructions 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.

@yinsustart

Copy link
Copy Markdown

/retest

@tiprow

tiprow Bot commented May 14, 2026

Copy link
Copy Markdown

@yinsustart: PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test.

Details

In response to this:

/retest

Instructions 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.

@yinsustart

Copy link
Copy Markdown

/retest

@tiprow

tiprow Bot commented May 14, 2026

Copy link
Copy Markdown

@yinsustart: PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test.

Details

In response to this:

/retest

Instructions 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.

@ti-chi-bot
ti-chi-bot Bot merged commit 9d8db7c into pingcap:master May 14, 2026
36 checks passed
yongman pushed a commit to yongman/tidb that referenced this pull request Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. 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: TestTiFlashAvailableAfterDownOneStore in pkg/ddl/tests/tiflash

4 participants