Skip to content

Commit

Permalink
xds: fix flow control test failure (#10773)
Browse files Browse the repository at this point in the history
  • Loading branch information
YifeiZhuang committed Dec 20, 2023
1 parent 7be2b6c commit f67ec2e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions xds/src/test/java/io/grpc/xds/XdsClientImplTestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isA;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
Expand Down Expand Up @@ -3004,7 +3005,7 @@ public void flowControlAbsent() throws Exception {
verifyResourceMetadataAcked(
CDS, CDS_RESOURCE, testClusterRoundRobin, VERSION_1, TIME_INCREMENT);
barrier.await();
verify(cdsResourceWatcher, times(1)).onChanged(any());
verify(cdsResourceWatcher, atLeastOnce()).onChanged(any());
String errorMsg = "CDS response Cluster 'cluster.googleapis.com2' validation error: "
+ "Cluster cluster.googleapis.com2: unspecified cluster discovery type";
call.verifyRequestNack(CDS, Arrays.asList(CDS_RESOURCE, anotherCdsResource), VERSION_1, "0001",
Expand Down Expand Up @@ -3067,8 +3068,8 @@ public void simpleFlowControl() throws Exception {
verifyResourceMetadataAcked(EDS, EDS_RESOURCE, testClusterLoadAssignment, VERSION_1,
TIME_INCREMENT);
barrier.await();
verify(edsResourceWatcher, times(1)).onChanged(edsUpdateCaptor.capture());
EdsUpdate edsUpdate = edsUpdateCaptor.getValue();
verify(edsResourceWatcher, atLeastOnce()).onChanged(edsUpdateCaptor.capture());
EdsUpdate edsUpdate = edsUpdateCaptor.getAllValues().get(0);
validateGoldenClusterLoadAssignment(edsUpdate);
barrier.await();
latch.await(10, TimeUnit.SECONDS);
Expand Down

0 comments on commit f67ec2e

Please sign in to comment.