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 2026/03/22 15:52:55 UTC

(ratis) branch master updated: RATIS-2442. Wait for configuration to be applied to listeners in test (#1383)

This is an automated email from the ASF dual-hosted git repository.

szetszwo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ratis.git


The following commit(s) were added to refs/heads/master by this push:
     new b3b855ba8 RATIS-2442. Wait for configuration to be applied to listeners in test (#1383)
b3b855ba8 is described below

commit b3b855ba8d7bd3da3bb6cd36b6b3e754ab7b7ad0
Author: Abhishek Pal <pa...@gmail.com>
AuthorDate: Sun Mar 22 21:22:49 2026 +0530

    RATIS-2442. Wait for configuration to be applied to listeners in test (#1383)
---
 .../test/java/org/apache/ratis/server/impl/LeaderElectionTests.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ratis-server/src/test/java/org/apache/ratis/server/impl/LeaderElectionTests.java b/ratis-server/src/test/java/org/apache/ratis/server/impl/LeaderElectionTests.java
index 6959bd342..3a47d127c 100644
--- a/ratis-server/src/test/java/org/apache/ratis/server/impl/LeaderElectionTests.java
+++ b/ratis-server/src/test/java/org/apache/ratis/server/impl/LeaderElectionTests.java
@@ -64,7 +64,6 @@ import java.util.stream.Collectors;
 
 import static org.apache.ratis.RaftTestUtil.getPeersWithPriority;
 import static org.apache.ratis.RaftTestUtil.waitForLeader;
-import static org.apache.ratis.proto.RaftProtos.RaftPeerRole.LISTENER;
 import static org.apache.ratis.server.metrics.LeaderElectionMetrics.LAST_LEADER_ELECTION_ELAPSED_TIME;
 import static org.apache.ratis.server.metrics.LeaderElectionMetrics.LEADER_ELECTION_COUNT_METRIC;
 import static org.apache.ratis.server.metrics.LeaderElectionMetrics.LEADER_ELECTION_TIME_TAKEN;
@@ -557,6 +556,8 @@ public abstract class LeaderElectionTests<CLUSTER extends MiniRaftCluster>
         Collection<RaftPeer> peer = leader.getRaftConf().getAllPeers(RaftProtos.RaftPeerRole.LISTENER);
         assertEquals(0, peer.size());
 
+        RaftServerTestUtil.waitAndCheckNewConf(cluster, cluster.getPeers(), 0, null);
+
         listeners = cluster.getListeners()
                   .stream().map(RaftServer.Division::getPeer).collect(Collectors.toList());
         assertEquals(0, listeners.size());