xds: fix the EDS dups test so it doesn't assume address order (#9786)

This commit is contained in:
Sergii Tkachenko 2023-01-04 13:47:07 -05:00 committed by GitHub
parent f40231e147
commit 040e2831e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -1096,10 +1096,11 @@ public class RingHashLoadBalancerTest {
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) {