pd
pd copied to clipboard
tests/server: reduce test time for heartbeat msg cannot be triggered
What problem does this PR solve?
Issue Number: Ref #7969
What is changed and how does it work?
Performance
can reduce test time from 5s+1min(wait for keepalive) to 5s
Why change?
Previous test want to mock client send region heartbeat to server, and then server will return msg to client.
But Previous test only can be triggered by keepalive https://github.com/tikv/pd/blob/f51f9134558e793e7ea08fc32cef672c7afa37b7/pkg/schedule/hbstream/heartbeat_streams.go#L154 So I changed region id to 0 which will send error msg https://github.com/tikv/pd/blob/5c58dddc66feb343e19d7f792852bb5b6184d9dd/server/grpc_service.go#L1279-L1284 and then client will get msg by https://github.com/tikv/pd/blob/f51f9134558e793e7ea08fc32cef672c7afa37b7/pkg/schedule/hbstream/heartbeat_streams.go#L127
Check List
Tests
- Unit test
Release note
None.
[REVIEW NOTIFICATION]
This pull request has not been approved.
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.
Codecov Report
Merging #7998 (18e96a6) into master (67461dd) will increase coverage by
0.03%
. Report is 1 commits behind head on master. The diff coverage isn/a
.
Additional details and impacted files
@@ Coverage Diff @@
## master #7998 +/- ##
==========================================
+ Coverage 77.27% 77.30% +0.03%
==========================================
Files 468 468
Lines 60890 60890
==========================================
+ Hits 47055 47074 +19
+ Misses 10291 10288 -3
+ Partials 3544 3528 -16
Flag | Coverage Δ | |
---|---|---|
unittests | 77.30% <ø> (+0.03%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
@rleungx @lhy1024 friendly ping :)
@rleungx @lhy1024 friendly ping :)