Skip to content

test: stabilize flaky TestLoadLargeRules#10938

Open
flaky-claw wants to merge 1 commit into
tikv:masterfrom
flaky-claw:flakyfixer/case_ac41bf0af124-a3
Open

test: stabilize flaky TestLoadLargeRules#10938
flaky-claw wants to merge 1 commit into
tikv:masterfrom
flaky-claw:flakyfixer/case_ac41bf0af124-a3

Conversation

@flaky-claw

@flaky-claw flaky-claw commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #10346

Problem Summary:
Flaky test TestLoadLargeRules in github.com/tikv/pd/pkg/mcs/scheduling/server/rule intermittently fails, so this PR stabilizes that path.

What changed and how does it work?

Root Cause

Durable embedded-etcd setup writes could consume the test budget before the watcher load assertion was reached.

Fix

Setting UnsafeNoFsync removes irrelevant unit-test disk durability cost while preserving etcd-backed bulk setup and watcher loading.

Verification

Spec:

  • target: github.com/tikv/pd/pkg/mcs/scheduling/server/rule :: TestLoadLargeRules
  • strategy: pd.issue_scoped.v1
  • 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
  • feedback surface source: baseline_only

Observed result:

  • status: passed
  • required case executed: yes
  • submission decision: ALLOWED
  • note: Required flaky case executed during validation.
    Required flaky case was not skipped.
    target_flaky_corrected passed.

Gate checklist:

  • diagnostic_timing_repro: SKIPPED
  • target_flaky_corrected: PASS
  • supplied_path_mismatch: SKIPPED
  • package_surface: SKIPPED
  • build: SKIPPED
  • external_ci: SKIPPED

Commands:

  • go test -json ./pkg/mcs/scheduling/server/rule -run '^TestLoadLargeRules$' -count=1

Release note

None

Fixes #10346

Summary by CodeRabbit

  • Tests
    • Updated the test environment configuration for watcher-related checks to use a faster in-process storage setup.
    • No user-facing behavior or product functionality was changed.

@ti-chi-bot ti-chi-bot Bot added the release-note-none Denotes a PR that doesn't merit a release note. label Jun 24, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

[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 huachaohuang 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

@ti-chi-bot ti-chi-bot Bot added contribution This PR is from a community contributor. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. dco-signoff: no Indicates the PR's author has not signed dco. labels Jun 24, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Hi @flaky-claw. Thanks for your PR.

I'm waiting for a tikv member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@ti-chi-bot

ti-chi-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Thanks for your pull request. Before we can look at it, you'll need to add a 'DCO signoff' to your commits.

📝 Please follow instructions in the contributing guide to update your commits with the DCO

Full details of the Developer Certificate of Origin can be found at developercertificate.org.

The list of commits missing DCO signoff:

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.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: db110cc3-de8f-48d1-bb05-8026a63224a7

📥 Commits

Reviewing files that changed from the base of the PR and between 51f4146 and eb91e20.

📒 Files selected for processing (1)
  • pkg/mcs/scheduling/server/rule/watcher_test.go

📝 Walkthrough

Walkthrough

The watcher test helper now starts embedded etcd with UnsafeNoFsync enabled. No watcher or rule-loading logic changed.

Changes

Watcher test setup

Layer / File(s) Summary
Embedded etcd config
pkg/mcs/scheduling/server/rule/watcher_test.go
prepare sets cfg.UnsafeNoFsync = true before starting the embedded etcd instance.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • tikv/pd#10884: Also changes pkg/mcs/scheduling/server/rule/watcher_test.go test setup around embedded etcd/rule loading behavior.

Suggested labels

lgtm, approved

Suggested reviewers

  • bufferflies
  • rleungx

Poem

A tiny test burrow, a flick of the nose,
fsync took a nap while the little server rose.
One switch for the watcher, neat and bright,
And the carrot-lit tests scampered through the night.
🐇

🚥 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 clearly states the main change: stabilizing TestLoadLargeRules.
Description check ✅ Passed The description includes the required issue link, problem, fix, verification, and release note fields.
Linked Issues check ✅ Passed The change directly addresses #10346 by reducing embedded-etcd fsync overhead to stabilize TestLoadLargeRules.
Out of Scope Changes check ✅ Passed The PR only changes the test setup needed to fix the flaky rule-loading test.

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

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

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.

@ti-chi-bot ti-chi-bot Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution This PR is from a community contributor. dco-signoff: no Indicates the PR's author has not signed dco. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. 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.

TestLoadLargeRules is flaky

1 participant