Repository: incubator-ratis Updated Branches: refs/heads/master 326acb087 -> 2ca8b934b
Revert "RATIS-201. RaftBasicTests.testWithLoad should use RaftTestUtil.waitForLeader instead of cluster.getLeader(). Contributed by Lokesh Jain" This reverts commit cb7e6d42904ed91d960c8dd8c9e49d0f0461c228. Project: http://git-wip-us.apache.org/repos/asf/incubator-ratis/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ratis/commit/2ca8b934 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ratis/tree/2ca8b934 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ratis/diff/2ca8b934 Branch: refs/heads/master Commit: 2ca8b934bf55c57f55108524189c6a7789cb35c3 Parents: 326acb0 Author: Tsz-Wo Nicholas Sze <[email protected]> Authored: Mon Feb 5 16:41:58 2018 -0800 Committer: Tsz-Wo Nicholas Sze <[email protected]> Committed: Mon Feb 5 16:41:58 2018 -0800 ---------------------------------------------------------------------- ratis-server/src/test/java/org/apache/ratis/RaftBasicTests.java | 2 +- ratis-server/src/test/java/org/apache/ratis/RaftTestUtil.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ratis/blob/2ca8b934/ratis-server/src/test/java/org/apache/ratis/RaftBasicTests.java ---------------------------------------------------------------------- diff --git a/ratis-server/src/test/java/org/apache/ratis/RaftBasicTests.java b/ratis-server/src/test/java/org/apache/ratis/RaftBasicTests.java index 4fac472..f4156d4 100644 --- a/ratis-server/src/test/java/org/apache/ratis/RaftBasicTests.java +++ b/ratis-server/src/test/java/org/apache/ratis/RaftBasicTests.java @@ -346,7 +346,7 @@ public abstract class RaftBasicTests extends BaseTest { lastStep.set(n); count++; - RaftServerImpl leader = waitForLeader(cluster, true); + RaftServerImpl leader = cluster.getLeader(); if (leader != null) { RaftTestUtil.changeLeader(cluster, leader.getId()); } http://git-wip-us.apache.org/repos/asf/incubator-ratis/blob/2ca8b934/ratis-server/src/test/java/org/apache/ratis/RaftTestUtil.java ---------------------------------------------------------------------- diff --git a/ratis-server/src/test/java/org/apache/ratis/RaftTestUtil.java b/ratis-server/src/test/java/org/apache/ratis/RaftTestUtil.java index 3d7f791..c55445a 100644 --- a/ratis-server/src/test/java/org/apache/ratis/RaftTestUtil.java +++ b/ratis-server/src/test/java/org/apache/ratis/RaftTestUtil.java @@ -71,6 +71,7 @@ public interface RaftTestUtil { LOG.info(cluster.printServers(groupId)); RaftServerImpl leader = null; for(int i = 0; leader == null && i < 10; i++) { + Thread.sleep(sleepTime); try { leader = cluster.getLeader(groupId); } catch(IllegalStateException e) { @@ -78,7 +79,6 @@ public interface RaftTestUtil { throw e; } } - Thread.sleep(sleepTime); } LOG.info(cluster.printServers(groupId)); return leader;
