Github user anmolnar commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/451#discussion_r163570637
--- Diff:
src/java/test/org/apache/zookeeper/client/StaticHostProviderTest.java ---
@@ -117,8 +117,32 @@ public void testTwoInvalidHostAddresses() {
list.add(new InetSocketAddress("a", 2181));
list.add(new InetSocketAddress("b", 2181));
new StaticHostProvider(list);
+ }
+
+ @Test
+ public void testReResolving() {
+ byte size = 1;
+ ArrayList<InetSocketAddress> list = new
ArrayList<InetSocketAddress>(size);
+
+ // Test a hostname that resolves to multiple addresses
--- End diff --
Common domain names like facebook.com, google.com or apache.org don't use
round-robin DNS anymore for some reason, so they don't resolve to multiple
addresses. As a consequence this test doesn't validate the branch related to
multiple addresses anymore unfortunately.
Not sure how to address that, PowerMock would be the best to mock static
`getAllByName()` method, but that would involve introducing a new test
dependency.
---