Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource_manager: Fix for delayed deletion of created groups in TestWatchResourceGroup #7154

Merged
merged 2 commits into from
Sep 27, 2023

Conversation

HuSharp
Copy link
Member

@HuSharp HuSharp commented Sep 26, 2023

What problem does this PR solve?

Issue Number: Close #7144

What is changed and how does it work?

  • When the test is complete cleanupResourceGroups will be executed. However, the watch mechanism in ci is not immediately available due to machine performance.
    aa6b2607-e2f8-4d94-93d0-209e78335f87
    For TestWatchResourceGroups that have groups created at begin, deletions (the delayed deletions mentioned above which result from last Test finished) may be encountered after creation, causing creation to not work.
  • refine all tests
  • run this change many times test watch resource group HuSharp/pd#2
  • remove redundant code

Check List

Tests

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

Release note

None.

Signed-off-by: husharp <[email protected]>
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 26, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • CabinfeverB
  • nolouch

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot bot added the release-note-none Denotes a PR that doesn't merit a release note. label Sep 26, 2023
@HuSharp HuSharp requested a review from CabinfeverB September 26, 2023 07:09
@ti-chi-bot ti-chi-bot bot requested review from lhy1024 and rleungx September 26, 2023 07:09
@HuSharp HuSharp requested review from JmPotato and nolouch and removed request for lhy1024 and rleungx September 26, 2023 07:09
@ti-chi-bot ti-chi-bot bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 26, 2023
@HuSharp
Copy link
Member Author

HuSharp commented Sep 26, 2023

I have run resource_manager_test.go many times and don't meet an error.
HuSharp#2

Copy link
Member

@JmPotato JmPotato left a comment

Choose a reason for hiding this comment

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

The reset LGTM.

re := suite.Require()
cli := suite.client
group := &rmpb.ResourceGroup{
Name: "test",
Name: "watch_test",
Copy link
Member

Choose a reason for hiding this comment

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

What about using a const?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@@ -1265,14 +1288,14 @@ func (suite *resourceManagerClientTestSuite) TestCheckBackgroundJobs() {
return false
}, testutil.WithTickInterval(50*time.Millisecond))

resourceGroupName = suite.initGroups[0].Name
resourceGroupName = "background_unable"
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

Copy link
Member Author

Choose a reason for hiding this comment

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

use a func to distinguish

Signed-off-by: husharp <[email protected]>
@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

Merging #7154 (33382d8) into master (eb6953f) will increase coverage by 0.07%.
Report is 1 commits behind head on master.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #7154      +/-   ##
==========================================
+ Coverage   74.26%   74.34%   +0.07%     
==========================================
  Files         441      441              
  Lines       47216    47217       +1     
==========================================
+ Hits        35064    35102      +38     
+ Misses       9063     9015      -48     
- Partials     3089     3100      +11     
Flag Coverage Δ
unittests 74.34% <100.00%> (+0.07%) ⬆️

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

@@ -129,20 +129,6 @@ func (suite *resourceManagerClientTestSuite) SetupSuite() {
},
},
},
{
Copy link
Contributor

Choose a reason for hiding this comment

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

why remove this case?

Comment on lines +1239 to 1245
enableBackgroundGroup := func(enable bool) string {
if enable {
return "background_enable"
} else {
return "background_unable"
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

used enableBackgroundGroup instead of unnecessary using initGroups cc @nolouch

Copy link
Contributor

@nolouch nolouch left a comment

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 the status/LGT1 Indicates that a PR has LGTM 1. label Sep 26, 2023
@ti-chi-bot ti-chi-bot bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 27, 2023
@nolouch
Copy link
Contributor

nolouch commented Sep 27, 2023

/merge

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 27, 2023

@nolouch: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

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 ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 27, 2023

This pull request has been accepted and is ready to merge.

Commit hash: 33382d8

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 27, 2023
@ti-chi-bot ti-chi-bot bot merged commit 985e2a4 into tikv:master Sep 27, 2023
@HuSharp HuSharp deleted the regine_watch_test branch September 28, 2023 01:20
nolouch pushed a commit to ti-chi-bot/pd that referenced this pull request Dec 6, 2023
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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unstable TestWatchResourceGroup
4 participants