8787import io .grpc .xds .client .Bootstrapper .BootstrapInfo ;
8888import io .grpc .xds .client .Bootstrapper .CertificateProviderInfo ;
8989import io .grpc .xds .client .Bootstrapper .ServerInfo ;
90+ import io .grpc .xds .client .ControlPlaneClientTestBase ;
9091import io .grpc .xds .client .EnvoyProtoData .Node ;
9192import io .grpc .xds .client .LoadStatsManager2 .ClusterDropStats ;
9293import io .grpc .xds .client .Locality ;
140141@ RunWith (JUnit4 .class )
141142// The base class was used to test both xds v2 and v3. V2 is dropped now so the base class is not
142143// necessary. Still keep it for future version usage. Remove if too much trouble to maintain.
143- public abstract class GrpcXdsClientImplTestBase {
144+ public abstract class GrpcXdsClientImplTestBase extends ControlPlaneClientTestBase {
144145 private static final String SERVER_URI = "trafficdirector.googleapis.com" ;
145146 private static final String SERVER_URI_CUSTOME_AUTHORITY = "trafficdirector2.googleapis.com" ;
146147 private static final String SERVER_URI_EMPTY_AUTHORITY = "trafficdirector3.googleapis.com" ;
@@ -2758,7 +2759,7 @@ public void edsResourceNotFound() {
27582759 }
27592760
27602761 @ Test
2761- public void edsAllowRespondAfterUnsubscription () {
2762+ public void edsCleanupNonceAfterUnsubscription () {
27622763 Assume .assumeFalse (ignoreResourceDeletion ());
27632764
27642765 // Suppose we have an EDS subscription A.1
@@ -2776,6 +2777,7 @@ public void edsAllowRespondAfterUnsubscription() {
27762777 call .sendResponse (EDS , resourcesV1 .values ().asList (), VERSION_1 , "0000" );
27772778 // {A.1} -> ACK, version 1
27782779 verifyResourceMetadataAcked (EDS , "A.1" , resourcesV1 .get ("A.1" ), VERSION_1 , TIME_INCREMENT );
2780+ call .verifyRequest (EDS , "A.1" , VERSION_1 , "0000" , NODE );
27792781 verify (edsResourceWatcher , times (1 )).onChanged (any ());
27802782
27812783 // trigger an EDS resource unsubscription.
@@ -2784,17 +2786,9 @@ public void edsAllowRespondAfterUnsubscription() {
27842786 // 1) the EDS unsubscription caused by CDS PUSH e1 (client-side) and,
27852787 // 2) the immediate EDS PUSH from XdsServer (server-side) after CDS PUSH e1 (event e2).
27862788 xdsClient .cancelXdsResourceWatch (XdsEndpointResource .getInstance (), "A.1" , edsResourceWatcher );
2787- // FIX(1): allow to send empty subscription
2788- call .verifyRequest (EDS , Collections .emptyList (), VERSION_1 , "0000" , NODE );
27892789 verifySubscribedResourcesMetadataSizes (0 , 0 , 0 , 0 );
2790- // An EDS PUSH after CDS PUSH e1.
2791- List <Message > endpointsV2 = ImmutableList .of (lbEndpointHealthy );
2792- ImmutableMap <String , Any > resourcesV2 = ImmutableMap .of (
2793- "A.1" , Any .pack (mf .buildClusterLoadAssignment ("A.1" , endpointsV2 , dropOverloads )));
2794- call .sendResponse (EDS , resourcesV2 .values ().asList (), VERSION_2 , "0001" );
2795- // FIX(2): allow to update resource version even if the subscription resource is empty
2796- call .verifyRequest (EDS , Collections .emptyList (), VERSION_2 , "0001" , NODE );
2797- verifyNoMoreInteractions (edsResourceWatcher );
2790+ // The nonce has been removed
2791+ assertThat (getNonceForResourceType (xdsClient , xdsServerInfo , EDS )).isNull ();
27982792 }
27992793
28002794 @ Test
0 commit comments