-
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
tests/discovery: reduce TestRegister cost time #7946
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. |
/hold |
/unhold |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #7946 +/- ##
=======================================
Coverage 73.58% 73.59%
=======================================
Files 436 436
Lines 48464 48464
=======================================
+ Hits 35661 35665 +4
+ Misses 9743 9742 -1
+ Partials 3060 3057 -3
Flags with carried forward coverage won't be shown. Click here to find out more. |
pkg/mcs/discovery/register_test.go
Outdated
b, _ := os.ReadFile(fname) | ||
l := string(b) | ||
count := strings.Count(l, "keep alive failed") | ||
return count >= i+1 |
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.
Could you please help explain the check here?
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.
- check log in function
ServiceRegister.Register
pd/pkg/mcs/discovery/register.go
Line 77 in 6377b26
log.Error("keep alive failed", zap.String("key", sr.key)) - count relates to the number of tests in the
for loop
to ensure that eacheventually
working well
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.
It's kind of tricky to me since we may have "keep alive failed" with different meanings in logs, how can we make sure it comes from the ServiceRegister.Register
definitely now and then?
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.
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
/merge |
@JmPotato: 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: 6455e67
|
What problem does this PR solve?
Issue Number: Ref #7930
What is changed and how does it work?
can reduce from 2min to 60s
check on log
Check List
Tests
Release note