You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by sy...@apache.org on 2020/10/24 13:28:50 UTC

[zookeeper] branch branch-3.6 updated: ZOOKEEPER-3981: Flaky test MultipleAddressTest::testGetValidAddressWithNotValid

This is an automated email from the ASF dual-hosted git repository.

symat pushed a commit to branch branch-3.6
in repository https://gitbox.apache.org/repos/asf/zookeeper.git


The following commit(s) were added to refs/heads/branch-3.6 by this push:
     new 79a91b9  ZOOKEEPER-3981: Flaky test MultipleAddressTest::testGetValidAddressWithNotValid
79a91b9 is described below

commit 79a91b95341bf417f3237d33846db19b39831712
Author: Michael Han <ha...@apache.org>
AuthorDate: Sat Oct 24 13:18:10 2020 +0000

    ZOOKEEPER-3981: Flaky test MultipleAddressTest::testGetValidAddressWithNotValid
    
    Problem:
    
    Test MultipleAddressTest::testGetValidAddressWithNotValid might fail deterministically when the address it's using, 10.0.0.1, is reachable, as per https://tools.ietf.org/html/rfc5735 10.0.0.1 might be allocatable to private network usage. In fact, the router address of my ISP is assigned this IP, leading to this test always failing for me.
    
    Solution:
    
    Replace the address with 240.0.0.0, which is reserved for future use and less likely to be reachable.
    
    Author: Michael Han <mi...@lianghan.org>
    Author: Michael Han <ha...@apache.org>
    
    Reviewers: Christopher Tubbs <ct...@apache.org>, Mate Szalay-Beko <sy...@apache.org>
    
    Closes #1511 from hanm/fixut
    
    (cherry picked from commit 3ff30a6427fdc2f13e60ff530800eca55ff02c9a)
    Signed-off-by: Mate Szalay-Beko <sy...@apache.org>
---
 .../java/org/apache/zookeeper/server/quorum/MultipleAddressesTest.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/MultipleAddressesTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/MultipleAddressesTest.java
index 0e1615d..e060fa8 100644
--- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/MultipleAddressesTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/MultipleAddressesTest.java
@@ -105,7 +105,8 @@ public class MultipleAddressesTest {
 
     @Test(expected = NoRouteToHostException.class)
     public void testGetValidAddressWithNotValid() throws NoRouteToHostException {
-        MultipleAddresses multipleAddresses = new MultipleAddresses(new InetSocketAddress("10.0.0.1", 22));
+        // IP chosen because it is reserved for documentation/examples and should be unreachable (RFC 5737)
+        MultipleAddresses multipleAddresses = new MultipleAddresses(new InetSocketAddress("203.0.113.1", 22));
         multipleAddresses.getReachableAddress();
     }