Verify that a SubConn is created with the expected address.
(t *testing.T, cc *testutils.BalancerClientConn, addr resolver.Address)
| 1259 | |
| 1260 | // Verify that a SubConn is created with the expected address. |
| 1261 | func verifyAddressInNewSubConn(t *testing.T, cc *testutils.BalancerClientConn, addr resolver.Address) { |
| 1262 | t.Helper() |
| 1263 | |
| 1264 | gotAddr := <-cc.NewSubConnAddrsCh |
| 1265 | wantAddr := []resolver.Address{addr} |
| 1266 | gotAddr[0].BalancerAttributes = nil |
| 1267 | if diff := cmp.Diff(gotAddr, wantAddr, cmp.AllowUnexported(attributes.Attributes{})); diff != "" { |
| 1268 | t.Fatalf("got unexpected new subconn addrs: %v", diff) |
| 1269 | } |
| 1270 | } |
| 1271 | |
| 1272 | // subConnWithAddr wraps a subConn and the address for which it was created. |
| 1273 | type subConnWithAddr struct { |
no test coverage detected