You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ho...@apache.org on 2022/03/03 20:55:37 UTC

[solr] branch main updated: SOLR-16074: Wait for leader to restart in doTestIndexFetchOnLeaderRestart

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

houston pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new d79cd71  SOLR-16074: Wait for leader to restart in doTestIndexFetchOnLeaderRestart
d79cd71 is described below

commit d79cd7117c366e3ea61101d59c60de79cdaf8996
Author: Houston Putman <ho...@apache.org>
AuthorDate: Thu Mar 3 15:55:06 2022 -0500

    SOLR-16074: Wait for leader to restart in doTestIndexFetchOnLeaderRestart
---
 .../src/test/org/apache/solr/handler/TestReplicationHandler.java   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
index 67b18f6..f228183 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
@@ -762,13 +762,16 @@ public class TestReplicationHandler extends SolrTestCaseJ4 {
 
       leaderJetty.start();
 
+      final TimeOut waitForLeaderToStart = new TimeOut(30, TimeUnit.SECONDS, TimeSource.NANO_TIME);
+      waitForLeaderToStart.waitFor(
+          "Gave up after waiting an obscene amount of time for leader to start",
+          () -> leaderJetty.isRunning());
+
       // poll interval on follower is 1 second, so we just sleep for a few seconds
       Thread.sleep(2000);
       // get docs from follower and assert that they are still the same as before
       followerQueryRsp = rQuery(nDocs, "*:*", followerClient);
-      followerQueryResult = (SolrDocumentList) followerQueryRsp.get("response");
       assertEquals(nDocs, numFound(followerQueryRsp));
-
     } finally {
       resetFactory();
     }