You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ta...@apache.org on 2023/01/18 07:19:41 UTC
[iotdb] branch rel/1.0 updated: [IOTDB-5429] Disable first election in RatisConsensus UT to avoid inconsistency states (#8897)
This is an automated email from the ASF dual-hosted git repository.
tanxinyu pushed a commit to branch rel/1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rel/1.0 by this push:
new 77b7a25785 [IOTDB-5429] Disable first election in RatisConsensus UT to avoid inconsistency states (#8897)
77b7a25785 is described below
commit 77b7a2578578a655d7bdb31f3aa36157245913ef
Author: William Song <48...@users.noreply.github.com>
AuthorDate: Wed Jan 18 15:19:34 2023 +0800
[IOTDB-5429] Disable first election in RatisConsensus UT to avoid inconsistency states (#8897)
---
.../java/org/apache/iotdb/consensus/ratis/RatisConsensusTest.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/consensus/src/test/java/org/apache/iotdb/consensus/ratis/RatisConsensusTest.java b/consensus/src/test/java/org/apache/iotdb/consensus/ratis/RatisConsensusTest.java
index 0fc5f33fed..0eda514016 100644
--- a/consensus/src/test/java/org/apache/iotdb/consensus/ratis/RatisConsensusTest.java
+++ b/consensus/src/test/java/org/apache/iotdb/consensus/ratis/RatisConsensusTest.java
@@ -34,6 +34,7 @@ import org.apache.iotdb.consensus.config.RatisConfig;
import org.apache.iotdb.consensus.exception.RatisRequestFailedException;
import org.apache.ratis.util.FileUtils;
+import org.apache.ratis.util.TimeDuration;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@@ -76,6 +77,13 @@ public class RatisConsensusTest {
.setAutoTriggerThreshold(100)
.setCreationGap(10)
.build())
+ .setRpc(
+ RatisConfig.Rpc.newBuilder()
+ .setFirstElectionTimeoutMin(TimeDuration.valueOf(1, TimeUnit.SECONDS))
+ .setFirstElectionTimeoutMax(TimeDuration.valueOf(4, TimeUnit.SECONDS))
+ .setTimeoutMin(TimeDuration.valueOf(1, TimeUnit.SECONDS))
+ .setTimeoutMax(TimeDuration.valueOf(4, TimeUnit.SECONDS))
+ .build())
.setImpl(
RatisConfig.Impl.newBuilder()
.setTriggerSnapshotFileSize(1)