@@ -167,7 +167,7 @@ func init() {
167167// glue code in weighted_target. It also tests an empty target config update,
168168// which should trigger a transient failure state update.
169169func (s ) TestWeightedTarget (t * testing.T ) {
170- cc := testutils .NewTestClientConn (t )
170+ cc := testutils .NewBalancerClientConn (t )
171171 wtb := wtbBuilder .Build (cc , balancer.BuildOptions {})
172172 defer wtb .Close ()
173173
@@ -329,7 +329,7 @@ func (s) TestWeightedTarget(t *testing.T) {
329329// have a weighted target balancer will one sub-balancer, and we add and remove
330330// backends from the subBalancer.
331331func (s ) TestWeightedTarget_OneSubBalancer_AddRemoveBackend (t * testing.T ) {
332- cc := testutils .NewTestClientConn (t )
332+ cc := testutils .NewBalancerClientConn (t )
333333 wtb := wtbBuilder .Build (cc , balancer.BuildOptions {})
334334 defer wtb .Close ()
335335
@@ -427,7 +427,7 @@ func (s) TestWeightedTarget_OneSubBalancer_AddRemoveBackend(t *testing.T) {
427427// TestWeightedTarget_TwoSubBalancers_OneBackend tests the case where we have a
428428// weighted target balancer with two sub-balancers, each with one backend.
429429func (s ) TestWeightedTarget_TwoSubBalancers_OneBackend (t * testing.T ) {
430- cc := testutils .NewTestClientConn (t )
430+ cc := testutils .NewBalancerClientConn (t )
431431 wtb := wtbBuilder .Build (cc , balancer.BuildOptions {})
432432 defer wtb .Close ()
433433
@@ -493,7 +493,7 @@ func (s) TestWeightedTarget_TwoSubBalancers_OneBackend(t *testing.T) {
493493// a weighted target balancer with two sub-balancers, each with more than one
494494// backend.
495495func (s ) TestWeightedTarget_TwoSubBalancers_MoreBackends (t * testing.T ) {
496- cc := testutils .NewTestClientConn (t )
496+ cc := testutils .NewBalancerClientConn (t )
497497 wtb := wtbBuilder .Build (cc , balancer.BuildOptions {})
498498 defer wtb .Close ()
499499
@@ -637,7 +637,7 @@ func (s) TestWeightedTarget_TwoSubBalancers_MoreBackends(t *testing.T) {
637637// case where we have a weighted target balancer with two sub-balancers of
638638// differing weights.
639639func (s ) TestWeightedTarget_TwoSubBalancers_DifferentWeight_MoreBackends (t * testing.T ) {
640- cc := testutils .NewTestClientConn (t )
640+ cc := testutils .NewBalancerClientConn (t )
641641 wtb := wtbBuilder .Build (cc , balancer.BuildOptions {})
642642 defer wtb .Close ()
643643
@@ -718,7 +718,7 @@ func (s) TestWeightedTarget_TwoSubBalancers_DifferentWeight_MoreBackends(t *test
718718// have a weighted target balancer with three sub-balancers and we remove one of
719719// the subBalancers.
720720func (s ) TestWeightedTarget_ThreeSubBalancers_RemoveBalancer (t * testing.T ) {
721- cc := testutils .NewTestClientConn (t )
721+ cc := testutils .NewBalancerClientConn (t )
722722 wtb := wtbBuilder .Build (cc , balancer.BuildOptions {})
723723 defer wtb .Close ()
724724
@@ -879,7 +879,7 @@ func (s) TestWeightedTarget_ThreeSubBalancers_RemoveBalancer(t *testing.T) {
879879// where we have a weighted target balancer with two sub-balancers, and we
880880// change the weight of these subBalancers.
881881func (s ) TestWeightedTarget_TwoSubBalancers_ChangeWeight_MoreBackends (t * testing.T ) {
882- cc := testutils .NewTestClientConn (t )
882+ cc := testutils .NewBalancerClientConn (t )
883883 wtb := wtbBuilder .Build (cc , balancer.BuildOptions {})
884884 defer wtb .Close ()
885885
@@ -997,7 +997,7 @@ func (s) TestWeightedTarget_TwoSubBalancers_ChangeWeight_MoreBackends(t *testing
997997// the picks won't fail with transient_failure, and should instead wait for the
998998// other sub-balancer.
999999func (s ) TestWeightedTarget_InitOneSubBalancerTransientFailure (t * testing.T ) {
1000- cc := testutils .NewTestClientConn (t )
1000+ cc := testutils .NewBalancerClientConn (t )
10011001 wtb := wtbBuilder .Build (cc , balancer.BuildOptions {})
10021002 defer wtb .Close ()
10031003
@@ -1059,7 +1059,7 @@ func (s) TestWeightedTarget_InitOneSubBalancerTransientFailure(t *testing.T) {
10591059// connecting, the overall state stays in transient_failure, and all picks
10601060// return transient failure error.
10611061func (s ) TestBalancerGroup_SubBalancerTurnsConnectingFromTransientFailure (t * testing.T ) {
1062- cc := testutils .NewTestClientConn (t )
1062+ cc := testutils .NewBalancerClientConn (t )
10631063 wtb := wtbBuilder .Build (cc , balancer.BuildOptions {})
10641064 defer wtb .Close ()
10651065
@@ -1141,7 +1141,7 @@ func (s) TestBalancerGroup_SubBalancerTurnsConnectingFromTransientFailure(t *tes
11411141
11421142// Verify that a SubConn is created with the expected address and hierarchy
11431143// path cleared.
1144- func verifyAddressInNewSubConn (t * testing.T , cc * testutils.TestClientConn , addr resolver.Address ) {
1144+ func verifyAddressInNewSubConn (t * testing.T , cc * testutils.BalancerClientConn , addr resolver.Address ) {
11451145 t .Helper ()
11461146
11471147 gotAddr := <- cc .NewSubConnAddrsCh
@@ -1163,7 +1163,7 @@ type subConnWithAddr struct {
11631163//
11641164// Returned value is a map from subBalancer (identified by its config) to
11651165// subConns created by it.
1166- func waitForNewSubConns (t * testing.T , cc * testutils.TestClientConn , num int ) map [string ][]subConnWithAddr {
1166+ func waitForNewSubConns (t * testing.T , cc * testutils.BalancerClientConn , num int ) map [string ][]subConnWithAddr {
11671167 t .Helper ()
11681168
11691169 scs := make (map [string ][]subConnWithAddr )
@@ -1233,7 +1233,7 @@ func init() {
12331233// TestInitialIdle covers the case that if the child reports Idle, the overall
12341234// state will be Idle.
12351235func (s ) TestInitialIdle (t * testing.T ) {
1236- cc := testutils .NewTestClientConn (t )
1236+ cc := testutils .NewBalancerClientConn (t )
12371237 wtb := wtbBuilder .Build (cc , balancer.BuildOptions {})
12381238 defer wtb .Close ()
12391239
@@ -1274,7 +1274,7 @@ func (s) TestInitialIdle(t *testing.T) {
12741274// TestIgnoreSubBalancerStateTransitions covers the case that if the child reports a
12751275// transition from TF to Connecting, the overall state will still be TF.
12761276func (s ) TestIgnoreSubBalancerStateTransitions (t * testing.T ) {
1277- cc := & tcc {TestClientConn : testutils .NewTestClientConn (t )}
1277+ cc := & tcc {BalancerClientConn : testutils .NewBalancerClientConn (t )}
12781278
12791279 wtb := wtbBuilder .Build (cc , balancer.BuildOptions {})
12801280 defer wtb .Close ()
@@ -1314,17 +1314,17 @@ func (s) TestIgnoreSubBalancerStateTransitions(t *testing.T) {
13141314// tcc wraps a testutils.TestClientConn but stores all state transitions in a
13151315// slice.
13161316type tcc struct {
1317- * testutils.TestClientConn
1317+ * testutils.BalancerClientConn
13181318 states []balancer.State
13191319}
13201320
13211321func (t * tcc ) UpdateState (bs balancer.State ) {
13221322 t .states = append (t .states , bs )
1323- t .TestClientConn .UpdateState (bs )
1323+ t .BalancerClientConn .UpdateState (bs )
13241324}
13251325
13261326func (s ) TestUpdateStatePauses (t * testing.T ) {
1327- cc := & tcc {TestClientConn : testutils .NewTestClientConn (t )}
1327+ cc := & tcc {BalancerClientConn : testutils .NewBalancerClientConn (t )}
13281328
13291329 balFuncs := stub.BalancerFuncs {
13301330 UpdateClientConnState : func (bd * stub.BalancerData , s balancer.ClientConnState ) error {
0 commit comments