cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jolynch <...@git.apache.org>
Subject [GitHub] cassandra pull request #212: Rework the wait for healthy logic to count down...
Date Wed, 07 Nov 2018 22:11:00 GMT
Github user jolynch commented on a diff in the pull request:

    https://github.com/apache/cassandra/pull/212#discussion_r231697341
  
    --- Diff: test/unit/org/apache/cassandra/net/StartupClusterConnectivityCheckerTest.java
---
    @@ -69,33 +113,102 @@ public void tearDown()
         @Test
         public void execute_HappyPath()
         {
    -        Sink sink = new Sink(true, true);
    +        Sink sink = new Sink(true, true, peers);
             MessagingService.instance().addMessageSink(sink);
    -        Assert.assertTrue(connectivityChecker.execute(peers));
    +        Assert.assertTrue(localQuorumConnectivityChecker.execute(peers, this::getDatacenter));
             checkAllConnectionTypesSeen(sink);
         }
     
         @Test
         public void execute_NotAlive()
         {
    -        Sink sink = new Sink(false, true);
    +        Sink sink = new Sink(false, true, peers);
             MessagingService.instance().addMessageSink(sink);
    -        Assert.assertFalse(connectivityChecker.execute(peers));
    +        Assert.assertFalse(localQuorumConnectivityChecker.execute(peers, this::getDatacenter));
             checkAllConnectionTypesSeen(sink);
         }
     
         @Test
         public void execute_NoConnectionsAcks()
         {
    -        Sink sink = new Sink(true, false);
    +        Sink sink = new Sink(true, false, peers);
             MessagingService.instance().addMessageSink(sink);
    -        Assert.assertFalse(connectivityChecker.execute(peers));
    +        Assert.assertFalse(localQuorumConnectivityChecker.execute(peers, this::getDatacenter));
    +    }
    +
    +    @Test
    +    public void execute_LocalQuorum()
    +    {
    +        // local peer plus 3 peers from same dc shouldn't pass (4/6)
    +        Set<InetAddressAndPort> available = new HashSet<>();
    +        copyCount(peersAMinusLocal, available, NUM_PER_DC - 3);
    +        checkAvailable(localQuorumConnectivityChecker, available, false, true);
    +
    +        // local peer plus 4 peers from same dc should pass (5/6)
    +        available.clear();
    +        copyCount(peersAMinusLocal, available, NUM_PER_DC - 2);
    +        checkAvailable(localQuorumConnectivityChecker, available, true, true);
    +    }
    +
    +    @Test
    +    public void execute_GlobalQuorum()
    +    {
    +        // local dc passing shouldn'nt pass globally with two hosts down in datacenterB
    --- End diff --
    
    Ack, fixed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Mime
View raw message