Skip to content
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

Merged
merged 2 commits into from
Oct 26, 2017
Merged

clientv3/integration: add waitPinReady #8774

merged 2 commits into from
Oct 26, 2017

Conversation

gyuho
Copy link
Contributor

@gyuho gyuho commented Oct 26, 2017

RPC should be sent to trigger 'readyWait' on new pin address.
Otherwise, endpoints other than ep[0] may be pinned.

@gyuho gyuho requested a review from xiang90 October 26, 2017 20:52
@@ -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)
Copy link
Contributor

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?

@gyuho gyuho changed the title clientv3/integration: wait for endpoint pin before SetEndpoints clientv3/integration: add waitPinReady Oct 26, 2017
@gyuho
Copy link
Contributor Author

gyuho commented Oct 26, 2017

@xiang90 Just made it as separate util function.

Will merge after rebasing on #8769 and #8772.

@@ -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) {
Copy link
Contributor

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

@xiang90
Copy link
Contributor

xiang90 commented Oct 26, 2017

lgtm

gyuho added 2 commits October 26, 2017 15:11
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>
@gyuho gyuho merged commit f46c063 into etcd-io:master Oct 26, 2017
@gyuho gyuho deleted the sync branch October 26, 2017 22:13
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@9b26bde). Click here to learn what that means.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #8774   +/-   ##
=========================================
  Coverage          ?   76.08%           
=========================================
  Files             ?      360           
  Lines             ?    29629           
  Branches          ?        0           
=========================================
  Hits              ?    22544           
  Misses            ?     5515           
  Partials          ?     1570
Impacted Files Coverage Δ
clientv3/integration/util.go 66.66% <66.66%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9b26bde...6a8d6b6. Read the comment docs.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants