-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
clientv3/integration: add waitPinReady #8774
Conversation
@@ -70,6 +70,14 @@ func testBalancerUnderNetworkPartition(t *testing.T, op func(*clientv3.Client, c | |||
} | |||
defer cli.Close() | |||
|
|||
// wait for ep[0] to be pinned | |||
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) |
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.
we used this in a lot of places. can you abstract this to a func like waitPinReady or something?
@@ -96,3 +99,13 @@ func testBalancerUnderNetworkPartition(t *testing.T, op func(*clientv3.Client, c | |||
t.Errorf("balancer did not switch in time (%v)", err) | |||
} | |||
} | |||
|
|||
// waitPinReady waits until connection is up (new pinned address). | |||
func waitPinReady(t *testing.T, cli *clientv3.Client) { |
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.
move this to util.go
lgtm |
RPC should be sent to trigger 'readyWait' on new pin address. Otherwise, endpoints other than ep[0] may be pinned. Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #8774 +/- ##
=========================================
Coverage ? 76.08%
=========================================
Files ? 360
Lines ? 29629
Branches ? 0
=========================================
Hits ? 22544
Misses ? 5515
Partials ? 1570
Continue to review full report at Codecov.
|
RPC should be sent to trigger 'readyWait' on new pin address.
Otherwise, endpoints other than ep[0] may be pinned.