Skip to content

Fix fixcontrol unit test: add missing parameter and test data file#63266

Closed
Benjamin2037 with Copilot wants to merge 1 commit into
masterfrom
copilot/fix-ba0b3a58-09aa-4f2c-818a-844e0cb98199
Closed

Fix fixcontrol unit test: add missing parameter and test data file#63266
Benjamin2037 with Copilot wants to merge 1 commit into
masterfrom
copilot/fix-ba0b3a58-09aa-4f2c-818a-844e0cb98199

Conversation

Copilot AI commented Aug 28, 2025

Copy link
Copy Markdown
Contributor

The fixcontrol unit test was failing due to two issues in the test setup:

  1. Missing third parameter in LoadTestSuiteData call: The main_test.go file was calling LoadTestSuiteData with only two parameters, but all other test suites in the repository consistently use three parameters with true as the third parameter for cascades testing.

  2. Missing cascades test data file: When the third parameter is true, the test framework expects a _xut.json file (cascades output) in addition to the standard _in.json and _out.json files, but this file was missing.

Before:

testDataMap.LoadTestSuiteData("testdata", "fix_control_suite")

After:

testDataMap.LoadTestSuiteData("testdata", "fix_control_suite", true)

The test was failing with the error:

testdata: Errors on loading test data from file: open testdata/fix_control_suite_xut.json: no such file or directory

Changes made:

  • Added the missing true parameter to LoadTestSuiteData call to match the pattern used by all other planner tests
  • Created the required fix_control_suite_xut.json file by copying the existing output file structure
  • Verified that tests now pass correctly with the --tags=intest flag

This fix ensures consistency with the test framework patterns used throughout the TiDB codebase and resolves the unit test failure for the fix control functionality.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@ti-chi-bot

ti-chi-bot Bot commented Aug 28, 2025

Copy link
Copy Markdown

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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 do-not-merge/invalid-title do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Aug 28, 2025
@ti-chi-bot ti-chi-bot Bot added size/XS Denotes a PR that changes 0-9 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 Aug 28, 2025
@ti-chi-bot

ti-chi-bot Bot commented Aug 28, 2025

Copy link
Copy Markdown

Hi @Copilot. 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 commented Aug 28, 2025

Copy link
Copy Markdown

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

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

@pingcap-cla-assistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@tiprow

tiprow Bot commented Aug 28, 2025

Copy link
Copy Markdown

Hi @Copilot. 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 commented Aug 28, 2025

Copy link
Copy Markdown

[FORMAT CHECKER NOTIFICATION]

Notice: To remove the do-not-merge/invalid-title label, please follow title format, for example pkg [, pkg2, pkg3]: what is changed or *: what is changed.

📖 For more info, you can check the "Contribute Code" section in the development guide.


Notice: To remove the do-not-merge/needs-linked-issue label, please provide the linked issue number on one line in the PR body, for example: Issue Number: close #123 or Issue Number: ref #456.

📖 For more info, you can check the "Contribute Code" section in the development guide.


Notice: To remove the do-not-merge/needs-tests-checked label, please finished the tests then check the finished items in description.

For example:

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

📖 For more info, you can check the "Contribute Code" section in the development guide.

@kennytm
kennytm deleted the copilot/fix-ba0b3a58-09aa-4f2c-818a-844e0cb98199 branch August 28, 2025 10:12
Copilot AI changed the title [WIP] 帮我 review 这个 fix ut 的pr Fix fixcontrol unit test: add missing parameter and test data file Aug 28, 2025
Copilot AI requested a review from Benjamin2037 August 28, 2025 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/invalid-title do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. 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.

2 participants