@@ -156,48 +156,17 @@ public void validateTestRequestToEchoServerViaEnvoy() throws InterruptedExceptio
156
156
assertThat (errorDetails .toString ()).isEqualTo ("" );
157
157
}
158
158
);
159
- }
160
-
161
- @ Test
162
- public void validateNewSnapshotVersionButSameUnderlyingResourcesDoesNotTriggerUpdate ()
163
- throws InterruptedException {
164
- assertThat (onStreamOpenLatch .await (15 , TimeUnit .SECONDS )).isTrue ()
165
- .overridingErrorMessage ("failed to open ADS stream" );
166
-
167
- assertThat (onStreamRequestLatch .await (15 , TimeUnit .SECONDS )).isTrue ()
168
- .overridingErrorMessage ("failed to receive ADS request" );
169
-
170
- // there is no onStreamResponseLatch because V3DiscoveryServer doesn't call the callbacks
171
- // when responding to a delta request
172
-
173
- String baseUri = String
174
- .format ("http://%s:%d" , ENVOY .getContainerIpAddress (), ENVOY .getMappedPort (LISTENER_PORT ));
175
-
176
- await ().atMost (5 , TimeUnit .SECONDS ).ignoreExceptions ().untilAsserted (
177
- () -> given ().baseUri (baseUri ).contentType (ContentType .TEXT )
178
- .when ().get ("/" )
179
- .then ().statusCode (200 )
180
- .and ().body (containsString (UPSTREAM .response )));
181
-
182
- // we'll count three nonces of "0" and make sure we've gotten no errors
183
- assertThat (errorDetails .toString ()).isEqualTo ("" );
184
- assertThat (resourceToNonceMap .containsKey (V3 .CLUSTER_TYPE_URL )).isTrue ();
185
- assertThat (resourceToNonceMap .get (V3 .CLUSTER_TYPE_URL ).toString ()).isEqualTo ("0" );
186
- assertThat (resourceToNonceMap .containsKey (V3 .LISTENER_TYPE_URL )).isTrue ();
187
- assertThat (resourceToNonceMap .get (V3 .LISTENER_TYPE_URL ).toString ()).isEqualTo ("0" );
188
- assertThat (resourceToNonceMap .containsKey (V3 .ROUTE_TYPE_URL )).isTrue ();
189
- assertThat (resourceToNonceMap .get (V3 .ROUTE_TYPE_URL ).toString ()).isEqualTo ("0" );
190
159
191
160
// now write a new snapshot, with no changes to the params we pass in
192
161
// but update version. This being a Delta request, this version doesn't
193
162
// really matter, and Envoy should not receive a spontaneous update
194
163
// because the hash of the resources will be the same
195
- Snapshot snapshot = V3TestSnapshots .createSnapshotNoEds (false ,
164
+ snapshot = V3TestSnapshots .createSnapshotNoEds (false ,
196
165
true ,
197
166
"upstream" ,
198
167
UPSTREAM .ipAddress (),
199
168
EchoContainer .PORT ,
200
- "listener0 " ,
169
+ "listener1 " ,
201
170
LISTENER_PORT ,
202
171
"route0" ,
203
172
"2" );
@@ -207,12 +176,13 @@ public void validateNewSnapshotVersionButSameUnderlyingResourcesDoesNotTriggerUp
207
176
snapshot
208
177
);
209
178
210
- await ().atMost (3 , TimeUnit .SECONDS ).untilAsserted (
179
+ // delay polling by 2 seconds to check that no upsates are received
180
+ await ().pollDelay (2 , TimeUnit .SECONDS ).atMost (5 , TimeUnit .SECONDS ).untilAsserted (
211
181
() -> {
212
182
assertThat (resourceToNonceMap .containsKey (V3 .CLUSTER_TYPE_URL )).isTrue ();
213
183
assertThat (resourceToNonceMap .get (V3 .CLUSTER_TYPE_URL ).toString ()).isEqualTo ("0" );
214
184
assertThat (resourceToNonceMap .containsKey (V3 .LISTENER_TYPE_URL )).isTrue ();
215
- assertThat (resourceToNonceMap .get (V3 .LISTENER_TYPE_URL ).toString ()).isEqualTo ("0 " );
185
+ assertThat (resourceToNonceMap .get (V3 .LISTENER_TYPE_URL ).toString ()).isEqualTo ("01 " );
216
186
assertThat (resourceToNonceMap .containsKey (V3 .ROUTE_TYPE_URL )).isTrue ();
217
187
assertThat (resourceToNonceMap .get (V3 .ROUTE_TYPE_URL ).toString ()).isEqualTo ("0" );
218
188
assertThat (errorDetails .toString ()).isEqualTo ("" );
0 commit comments