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

store/gcworker: migrate test-infra to testify for gc_worker_test.go #27657 #27743

Merged
merged 7 commits into from
Sep 4, 2021

Conversation

penthaapatel
Copy link
Contributor

@penthaapatel penthaapatel commented Sep 1, 2021

What problem does this PR solve?

Issue Number: closes #27657

What is changed and how it works?

What's Changed:

  • Migrate from pingcap/check to testify
  • Eliminate goroutine leak

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 1, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • disksing
  • tiancaiamao

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 added the release-note-none Denotes a PR that doesn't merit a release note. label Sep 1, 2021
@ti-srebot ti-srebot added the first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. label Sep 1, 2021
@ti-chi-bot ti-chi-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Sep 1, 2021
@ti-chi-bot
Copy link
Member

Welcome @penthaapatel!

It looks like this is your first PR to pingcap/tidb 🎉.

I'm the bot to help you request reviewers, add labels and more, See available commands.

We want to make sure your contribution gets all the attention it needs!



Thank you, and welcome to pingcap/tidb. 😃

@penthaapatel
Copy link
Contributor Author

/cc @tisonkun

Copy link
Contributor

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

@penthaapatel please fix CI fails like go fmt.

@penthaapatel
Copy link
Contributor Author

@tisonkun Just fixed using go fmt.
check_dev_2 CI still seems to be failing. Need some more guidance to proceed as I am a first-time contributor.

@penthaapatel
Copy link
Contributor Author

/cc @tisonkun
On running the package tests for store/gcworker with the original unchanged gc_worker_test.go file, the following tests for gcworker package were already failing on my system:

FAIL: gc_worker_test.go:1594: testGCWorkerSuite.TestGCLabelRules
FAIL: gc_worker_test.go:1582: testGCWorkerSuite.TestGCPlacementRules
FAIL: gc_worker_test.go:1538: testGCWorkerSuite.TestPhyscailScanLockDeadlock
FAIL: gc_worker_test.go:873: testGCWorkerSuite.TestResolveLockRangeInfine
FAIL: gc_worker_test.go:1350: testGCWorkerSuite.TestResolveLocksPhysical
OOPS: 21 passed, 5 FAILED
--- FAIL: TestT (28.04s)

Is this the reason why check_dev_2 CI is unable to pass?

The only changes I have made with this PR are:

  • improving the func SetUpTest() by using s *testGCWorkerSuite and clean() as the return values
  • incorporating func TearDownTest() within func SetUpTest()
  • as a result of the above change, I used func SetUpTest() at the beginning of each test, to create a new testGCWorkerSuite struct, and used defer clean() to tear down the test
  • replacing c.AssertXXX with testify/require package
  • adding t.Parallel() for imporved concurrency
  • checking for goroutine leaks in store/gcworker/main_test.go

I can assure that no changes have been made to the logic of the original gc_worker_test.go code.

How should I proceed further? First time contributor here.

@tisonkun
Copy link
Contributor

tisonkun commented Sep 2, 2021

@penthaapatel thanks for your quick update. I'm looking into this.

@tisonkun
Copy link
Contributor

tisonkun commented Sep 2, 2021

We're trying to avoid suite as mentioned #26082 (comment) .

When you really need to batch some setup/teardown logics and state, you can take a look at #27572 .

@tisonkun
Copy link
Contributor

tisonkun commented Sep 2, 2021

Let me try to push a follow up base on your change so that you can get the idea. Later you can reuse the experience on other tasks if you like.

Copy link
Contributor

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

@penthaapatel I push a follow up which you can take a look to get ideas on idiom. Sorry I don't have conversation for it since code expresses better than words in this case. You can argue or revert the changes if you have other better ideas.

@ti-chi-bot
Copy link
Member

@tisonkun: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

@penthaapatel I push a follow up which you can take a look to get ideas on idiom. Sorry I don't have conversation for it since code expresses better than words in this case. You can argue or revert the changes if you have other better ideas.

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.

@tisonkun
Copy link
Contributor

tisonkun commented Sep 2, 2021

/cc @disksing

Signed-off-by: tison <wander4096@gmail.com>
@penthaapatel
Copy link
Contributor Author

@tisonkun
I am going through the latest changes you pushed to the code. Working with such a huge codebase for the very first time is a learning experience for me. I will try to understand the code and will try to make further contributions here.
Thank you for patiently guiding me. I will reach out to you if I have any further queries/ideas.

@tiancaiamao tiancaiamao self-requested a review September 3, 2021 06:54
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 3, 2021
@tisonkun
Copy link
Contributor

tisonkun commented Sep 3, 2021

/run-check_dev_2

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 4, 2021
@tiancaiamao
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: d7cc89f

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 4, 2021
@ti-chi-bot
Copy link
Member

@penthaapatel: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

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.

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.

@zhouqiang-cl
Copy link
Contributor

/merge

@ti-chi-bot ti-chi-bot merged commit a11bfef into pingcap:master Sep 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ 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.

migrate test-infra to testify for store/gcworker
7 participants