Skip to content

Commit

Permalink
xds: fix the EDS dups test so it doesn't assume address order (grpc#9786
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sergiitk authored Jan 4, 2023
1 parent f40231e commit 040e283
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions xds/src/test/java/io/grpc/xds/RingHashLoadBalancerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1096,10 +1096,11 @@ public void duplicateAddresses() {
assertThat(result.getStatus().isOk()).isFalse(); // fail the RPC
assertThat(result.getStatus().getCode())
.isEqualTo(Code.UNAVAILABLE); // with error status for the original server hit by hash
assertThat(result.getStatus().getDescription()).isEqualTo(
"Ring hash lb error: EDS resolution was successful, but there were duplicate "
+ "addresses: Address: FakeSocketAddress-server1, count: 2; "
+ "Address: FakeSocketAddress-server2, count: 3");
String description = result.getStatus().getDescription();
assertThat(description).startsWith(
"Ring hash lb error: EDS resolution was successful, but there were duplicate addresses: ");
assertThat(description).contains("Address: FakeSocketAddress-server1, count: 2");
assertThat(description).contains("Address: FakeSocketAddress-server2, count: 3");
}

private void deliverSubchannelState(Subchannel subchannel, ConnectivityStateInfo state) {
Expand Down

0 comments on commit 040e283

Please sign in to comment.