Browse Source

ZOOKEEPER-2718: fix flaky StandaloneDisabledTest

The flaky (that existing for a long time) is caused by a ghost server that although not appear in the quorum's config but still up and running and send requests to the quorum {2, 3, 4}. Fix is simply kill the server 1 after it's used. Verified that with the fix the test survive stress test (100+ runs) while w/o the fix the tests fails frequently, on internal Jenkins machine.

ZOOKEEPER-2718: build bot do something please.

Author: Michael Han <hanm@apache.org>

Reviewers: Alexander Shraer <shralex@gmail.com>

Closes #190 from hanm/ZOOKEEPER-2178

(cherry picked from commit 57609043264f651cd2e44afceeca5b5890531161)
Signed-off-by: Michael Han <hanm@apache.org>
Michael Han 8 years ago
parent
commit
6949af062d

+ 3 - 0
src/java/test/org/apache/zookeeper/server/quorum/StandaloneDisabledTest.java

@@ -90,6 +90,9 @@ public class StandaloneDisabledTest extends QuorumPeerTestBase {
         LOG.info("Configuration after removing leader and follower 1:\n"
         LOG.info("Configuration after removing leader and follower 1:\n"
                 + new String(zkHandles[follower2].getConfig(this, new Stat())));
                 + new String(zkHandles[follower2].getConfig(this, new Stat())));
 
 
+        // Kill server 1 to avoid it interferences with FLE of the quorum {2, 3, 4}.
+        shutDownServer(follower1);
+
         // Try to remove follower2, which is the only remaining server. This should fail.
         // Try to remove follower2, which is the only remaining server. This should fail.
         reconfigServers.clear();
         reconfigServers.clear();
         reconfigServers.add(Integer.toString(follower2));
         reconfigServers.add(Integer.toString(follower2));