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

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


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

commit 4b42c7eecc4d53f6ed6100385166a9c854666870
Author: Houston Putman <[email protected]>
AuthorDate: Thu Mar 3 15:55:06 2022 -0500

    SOLR-16074: Wait for leader to restart in doTestIndexFetchOnLeaderRestart
    
    (cherry picked from commit d79cd7117c366e3ea61101d59c60de79cdaf8996)
---
 .../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();
     }

Reply via email to