You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ratis.apache.org by sz...@apache.org on 2018/02/06 21:29:36 UTC
incubator-ratis git commit: RATIS-201. RaftBasicTests.testWithLoad
may fail due to IllegalStateException. Contributed by Lokesh Jain
Repository: incubator-ratis
Updated Branches:
refs/heads/master 2ca8b934b -> 415bb3ed7
RATIS-201. RaftBasicTests.testWithLoad may fail due to IllegalStateException. Contributed by Lokesh Jain
Project: http://git-wip-us.apache.org/repos/asf/incubator-ratis/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ratis/commit/415bb3ed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ratis/tree/415bb3ed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ratis/diff/415bb3ed
Branch: refs/heads/master
Commit: 415bb3ed7fa7363e77ae4fd66195e5960a0cf479
Parents: 2ca8b93
Author: Tsz-Wo Nicholas Sze <sz...@hortonworks.com>
Authored: Tue Feb 6 13:28:46 2018 -0800
Committer: Tsz-Wo Nicholas Sze <sz...@hortonworks.com>
Committed: Tue Feb 6 13:28:46 2018 -0800
----------------------------------------------------------------------
.../src/test/java/org/apache/ratis/RaftBasicTests.java | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ratis/blob/415bb3ed/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 f4156d4..f79c857 100644
--- a/ratis-server/src/test/java/org/apache/ratis/RaftBasicTests.java
+++ b/ratis-server/src/test/java/org/apache/ratis/RaftBasicTests.java
@@ -346,9 +346,13 @@ public abstract class RaftBasicTests extends BaseTest {
lastStep.set(n);
count++;
- RaftServerImpl leader = cluster.getLeader();
- if (leader != null) {
- RaftTestUtil.changeLeader(cluster, leader.getId());
+ try {
+ RaftServerImpl leader = cluster.getLeader();
+ if (leader != null) {
+ RaftTestUtil.changeLeader(cluster, leader.getId());
+ }
+ } catch (IllegalStateException e) {
+ LOG.error("Failed to change leader ", e);
}
}
LOG.info("Leader change count=" + count);