87
87
import io .grpc .xds .client .Bootstrapper .BootstrapInfo ;
88
88
import io .grpc .xds .client .Bootstrapper .CertificateProviderInfo ;
89
89
import io .grpc .xds .client .Bootstrapper .ServerInfo ;
90
+ import io .grpc .xds .client .ControlPlaneClientTestBase ;
90
91
import io .grpc .xds .client .EnvoyProtoData .Node ;
91
92
import io .grpc .xds .client .LoadStatsManager2 .ClusterDropStats ;
92
93
import io .grpc .xds .client .Locality ;
140
141
@ RunWith (JUnit4 .class )
141
142
// The base class was used to test both xds v2 and v3. V2 is dropped now so the base class is not
142
143
// 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 {
144
145
private static final String SERVER_URI = "trafficdirector.googleapis.com" ;
145
146
private static final String SERVER_URI_CUSTOME_AUTHORITY = "trafficdirector2.googleapis.com" ;
146
147
private static final String SERVER_URI_EMPTY_AUTHORITY = "trafficdirector3.googleapis.com" ;
@@ -2758,7 +2759,7 @@ public void edsResourceNotFound() {
2758
2759
}
2759
2760
2760
2761
@ Test
2761
- public void edsAllowRespondAfterUnsubscription () {
2762
+ public void edsCleanupNonceAfterUnsubscription () {
2762
2763
Assume .assumeFalse (ignoreResourceDeletion ());
2763
2764
2764
2765
// Suppose we have an EDS subscription A.1
@@ -2776,6 +2777,7 @@ public void edsAllowRespondAfterUnsubscription() {
2776
2777
call .sendResponse (EDS , resourcesV1 .values ().asList (), VERSION_1 , "0000" );
2777
2778
// {A.1} -> ACK, version 1
2778
2779
verifyResourceMetadataAcked (EDS , "A.1" , resourcesV1 .get ("A.1" ), VERSION_1 , TIME_INCREMENT );
2780
+ call .verifyRequest (EDS , "A.1" , VERSION_1 , "0000" , NODE );
2779
2781
verify (edsResourceWatcher , times (1 )).onChanged (any ());
2780
2782
2781
2783
// trigger an EDS resource unsubscription.
@@ -2784,17 +2786,9 @@ public void edsAllowRespondAfterUnsubscription() {
2784
2786
// 1) the EDS unsubscription caused by CDS PUSH e1 (client-side) and,
2785
2787
// 2) the immediate EDS PUSH from XdsServer (server-side) after CDS PUSH e1 (event e2).
2786
2788
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 );
2789
2789
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 ();
2798
2792
}
2799
2793
2800
2794
@ Test
0 commit comments