Github user afine commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/451#discussion_r166479687
--- Diff:
src/java/test/org/apache/zookeeper/test/StaticHostProviderTest.java ---
@@ -117,8 +116,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
+ list.add(InetSocketAddress.createUnresolved("www.apache.org",
1234));
--- End diff --
Yeah, this is annoying. Although, another possibility would be to put the
dns calls in a method and then subclass `StaticHostProvider` for the tests and
overriding this method to return what you want.
---