@@ -27,7 +27,6 @@ import (
27
27
"github.com/google/go-cmp/cmp"
28
28
"github.com/google/go-cmp/cmp/cmpopts"
29
29
"google.golang.org/grpc/balancer"
30
- "google.golang.org/grpc/connectivity"
31
30
"google.golang.org/grpc/internal"
32
31
"google.golang.org/grpc/internal/grpctest"
33
32
internalserviceconfig "google.golang.org/grpc/internal/serviceconfig"
@@ -175,20 +174,6 @@ func (tb *testEDSBalancer) waitForClientConnUpdate(ctx context.Context, wantCCS
175
174
return nil
176
175
}
177
176
178
- // waitForSubConnUpdate verifies if the testEDSBalancer receives the provided
179
- // SubConn update before the context expires.
180
- func (tb * testEDSBalancer ) waitForSubConnUpdate (ctx context.Context , wantSCS subConnWithState ) error {
181
- scs , err := tb .scStateCh .Receive (ctx )
182
- if err != nil {
183
- return err
184
- }
185
- gotSCS := scs .(subConnWithState )
186
- if ! cmp .Equal (gotSCS , wantSCS , cmp .AllowUnexported (subConnWithState {})) {
187
- return fmt .Errorf ("received SubConnState: %+v, want %+v" , gotSCS , wantSCS )
188
- }
189
- return nil
190
- }
191
-
192
177
// waitForResolverError verifies if the testEDSBalancer receives the provided
193
178
// resolver error before the context expires.
194
179
func (tb * testEDSBalancer ) waitForResolverError (ctx context.Context , wantErr error ) error {
@@ -698,45 +683,6 @@ func (s) TestResolverError(t *testing.T) {
698
683
}
699
684
}
700
685
701
- // TestUpdateSubConnState verifies the UpdateSubConnState() method in the CDS
702
- // balancer.
703
- func (s ) TestUpdateSubConnState (t * testing.T ) {
704
- // This creates a CDS balancer, pushes a ClientConnState update with a fake
705
- // xdsClient, and makes sure that the CDS balancer registers a watch on the
706
- // provided xdsClient.
707
- xdsC , cdsB , edsB , _ , cancel := setupWithWatch (t )
708
- defer func () {
709
- cancel ()
710
- cdsB .Close ()
711
- }()
712
-
713
- // Here we invoke the watch callback registered on the fake xdsClient. This
714
- // will trigger the watch handler on the CDS balancer, which will attempt to
715
- // create a new EDS balancer. The fake EDS balancer created above will be
716
- // returned to the CDS balancer, because we have overridden the
717
- // newChildBalancer function as part of test setup.
718
- cdsUpdate := xdsresource.ClusterUpdate {
719
- ClusterName : serviceName ,
720
- LBPolicy : wrrLocalityLBConfigJSON ,
721
- }
722
- wantCCS := edsCCS (serviceName , nil , false , wrrLocalityLBConfigJSON , noopODLBCfgJSON )
723
- ctx , ctxCancel := context .WithTimeout (context .Background (), defaultTestTimeout )
724
- defer ctxCancel ()
725
- if err := invokeWatchCbAndWait (ctx , xdsC , cdsWatchInfo {cdsUpdate , nil }, wantCCS , edsB ); err != nil {
726
- t .Fatal (err )
727
- }
728
-
729
- // Push a subConn state change to the CDS balancer.
730
- var sc balancer.SubConn
731
- state := balancer.SubConnState {ConnectivityState : connectivity .Ready }
732
- cdsB .UpdateSubConnState (sc , state )
733
-
734
- // Make sure that the update is forwarded to the EDS balancer.
735
- if err := edsB .waitForSubConnUpdate (ctx , subConnWithState {sc : sc , state : state }); err != nil {
736
- t .Fatal (err )
737
- }
738
- }
739
-
740
686
// TestCircuitBreaking verifies that the CDS balancer correctly updates a
741
687
// service's counter on watch updates.
742
688
func (s ) TestCircuitBreaking (t * testing.T ) {
@@ -829,15 +775,6 @@ func (s) TestClose(t *testing.T) {
829
775
t .Fatalf ("UpdateClientConnState() after close returned %v, want %v" , err , errBalancerClosed )
830
776
}
831
777
832
- // Make sure that the UpdateSubConnState() method on the CDS balancer does
833
- // not forward the update to the EDS balancer.
834
- cdsB .UpdateSubConnState (& testutils.TestSubConn {}, balancer.SubConnState {})
835
- sCtx , sCancel = context .WithTimeout (context .Background (), defaultTestShortTimeout )
836
- defer sCancel ()
837
- if err := edsB .waitForSubConnUpdate (sCtx , subConnWithState {}); err != context .DeadlineExceeded {
838
- t .Fatal ("UpdateSubConnState() forwarded to EDS balancer after Close()" )
839
- }
840
-
841
778
// Make sure that the ResolverErr() method on the CDS balancer does not
842
779
// forward the update to the EDS balancer.
843
780
rErr := errors .New ("cdsBalancer resolver error" )
0 commit comments