Skip to content

planner: make rule tests ignore plan-id with explain format as brief#66013

Merged
ti-chi-bot[bot] merged 3 commits intopingcap:masterfrom
lostcache:fix-rule-tests
Feb 5, 2026
Merged

planner: make rule tests ignore plan-id with explain format as brief#66013
ti-chi-bot[bot] merged 3 commits intopingcap:masterfrom
lostcache:fix-rule-tests

Conversation

@lostcache
Copy link
Contributor

What problem does this PR solve?

Issue Number: ref #60940

Problem Summary: Some explain-test cases will record the plan ID in the result file, which will be a burden when some optimization flow is changed, since plan ID allocation is sequential according to the allocation order or space.

What changed and how does it work?

Made rule dual, constant propagation and result reorder tests ignore plan-id with explain format as brief.

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

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. contribution This PR is from a community contributor. labels Feb 4, 2026
@tiprow
Copy link

tiprow bot commented Feb 4, 2026

Hi @lostcache. 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.

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Feb 4, 2026
@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 4, 2026

Hi @lostcache. Thanks for your PR.

I'm waiting for a pingcap 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 added the sig/planner SIG: Planner label Feb 4, 2026
@terry1purcell
Copy link
Contributor

/ok-to-test

@ti-chi-bot ti-chi-bot bot added ok-to-test Indicates a PR is ready to be tested. and removed needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Feb 5, 2026
@terry1purcell terry1purcell requested a review from Copilot February 5, 2026 00:44
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 5, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modifies test cases to use EXPLAIN FORMAT = 'brief' instead of plain EXPLAIN to avoid including plan IDs in test result files. Plan IDs are sequentially allocated based on the optimization flow, and including them in test results makes tests brittle when optimization changes occur.

Changes:

  • Modified test files to add format = 'brief' to EXPLAIN statements
  • Updated expected result files to reflect the removal of plan IDs from output
  • Affected test files: rule_result_reorder, rule_constant_propagation, and dual tests

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/integrationtest/t/planner/core/rule_result_reorder.test Added format = 'brief' to 2 EXPLAIN statements
tests/integrationtest/t/planner/core/rule_constant_propagation.test Added FORMAT = 'brief' to 4 EXPLAIN statements
tests/integrationtest/r/planner/core/rule_result_reorder.result Updated expected output to show operator names without plan IDs (e.g., Limit instead of Limit_13)
tests/integrationtest/r/planner/core/rule_constant_propagation.result Updated expected output to show operator names without plan IDs
pkg/planner/core/casetest/rule/dual_test.go Added format = 'brief' to all EXPLAIN statements and updated expected output

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.6644%. Comparing base (6ff1adf) to head (a8d8dac).
⚠️ Report is 10 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #66013        +/-   ##
================================================
- Coverage   77.7600%   77.6644%   -0.0956%     
================================================
  Files          2001       1923        -78     
  Lines        546165     535349     -10816     
================================================
- Hits         424698     415776      -8922     
+ Misses       119805     119555       -250     
+ Partials       1662         18      -1644     
Flag Coverage Δ
integration 41.5211% <ø> (-6.6655%) ⬇️
unit 76.7181% <ø> (+0.3340%) ⬆️

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

Components Coverage Δ
dumpling 56.7974% <ø> (ø)
parser ∅ <ø> (∅)
br 48.8809% <ø> (-12.0909%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@fixdb fixdb left a comment

Choose a reason for hiding this comment

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

+1

@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 5, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fixdb, terry1purcell

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

@fixdb
Copy link
Contributor

fixdb commented Feb 5, 2026

/retest

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 5, 2026
@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 5, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-02-05 00:46:21.829558192 +0000 UTC m=+314252.930956911: ☑️ agreed by terry1purcell.
  • 2026-02-05 01:33:21.857568253 +0000 UTC m=+317072.958966973: ☑️ agreed by fixdb.

@ti-chi-bot ti-chi-bot bot merged commit c5e71c3 into pingcap:master Feb 5, 2026
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved contribution This PR is from a community contributor. lgtm ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants