Skip to content

Commit

Permalink
[xds_eds_endpoint_health] check new sc addrs
Browse files Browse the repository at this point in the history
  • Loading branch information
menghanl committed Nov 4, 2019
1 parent 4c225d3 commit 623a434
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion xds/internal/balancer/edsbalancer/edsbalancer_test.go
Expand Up @@ -409,8 +409,21 @@ func TestEDS_EndpointsHealth(t *testing.T) {
})
edsb.HandleEDSResponse(clab1.build())

var readySCs []balancer.SubConn
var (
readySCs []balancer.SubConn

wantNewSubConnAddrStrs = []string{
testEndpointAddrs[0],
testEndpointAddrs[2],
testEndpointAddrs[6],
testEndpointAddrs[8],
}
)
for i := 0; i < 4; i++ {
addr := <-cc.newSubConnAddrsCh
if addr[0].Addr != wantNewSubConnAddrStrs[i] {
t.Fatalf("want newSubConn with address %q, got %v", wantNewSubConnAddrStrs[i], addr)
}
sc := <-cc.newSubConnCh
edsb.HandleSubConnStateChange(sc, connectivity.Connecting)
edsb.HandleSubConnStateChange(sc, connectivity.Ready)
Expand Down

0 comments on commit 623a434

Please sign in to comment.