-
Notifications
You must be signed in to change notification settings - Fork 719
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
*: make unit test great #7952
*: make unit test great #7952
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Skipping CI for Draft Pull Request. |
} | ||
|
||
func (suite *resignTestSuite) TestResignMyself() { | ||
func (suite *memberTestSuite) TestResignMyself() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need to call suite.Clean()?
3d8d96f
to
2508337
Compare
bffc075
to
a982d7b
Compare
Signed-off-by: husharp <jinhao.hu@pingcap.com>
532b15b
to
5437e68
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #7952 +/- ##
==========================================
- Coverage 77.30% 73.66% -3.64%
==========================================
Files 468 436 -32
Lines 60879 48525 -12354
==========================================
- Hits 47061 35748 -11313
+ Misses 10284 9719 -565
+ Partials 3534 3058 -476
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
||
func usage() bool { | ||
msg := `// run all tests | ||
pd-ut |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to name this as dev
, as we can do more scope with dev
command , such as
./dev lint
./dev test pkg/util
./dev generator swagger
./dev bench heartbeat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe can unify all tools in another pr
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
@@ -225,6 +228,12 @@ failpoint-disable: install-tools | |||
|
|||
#### Test #### | |||
|
|||
ut: pd-ut |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a timeout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe need to reduce timeout for each test when enabled race
https://github.com/tikv/pd/pull/7952/files#diff-d1de7e6511458d33a769c0c501ec0ea45494dd9d2e830dc315e8fe623eb34b76R569-R574
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
/merge |
@HuSharp: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
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. |
This pull request has been accepted and is ready to merge. Commit hash: c235324
|
@HuSharp: Your PR was out of date, I have automatically updated it for you. 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. |
What problem does this PR solve?
Issue Number: Ref #7969
What is changed and how does it work?
Add back parallel by run a single test case in a isolated OS process
We use a wrong way to parallel. Some test cases are not side effect free, for example:
etc...
If the test cases with side effect run parallelly with others, it could cause some test fail unexpectedly.
When they're in a single OS process, make them parallel is not a big deal.
usage
use xprog to accelerate bin.test build
go test --exec=xprog, the Go compile toolchain would call your xprog program passing the test binary path as the argument
So you can do this trick, write you own xprog, and move the test binary to some place else, save it for later use.
print function time
when using ./pd-ut run --junitfile xxx, can get junitfile as XML file to get every function cost time.
Performance
Since we run parallel now, the CI runs faster than before, on my server computer (Intel(R) Xeon(R) Gold 6240 CPU @ 2.60GH, 144 core 72 CPU):
reduce from 6min -> 1min
for make ut:
for make basic-test
Check List
Tests
Release note