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 8160f9ffff8 Fix small race condition in DeleteReplicaTest
8160f9ffff8 is described below

commit 8160f9ffff86ab34fb92c6f8fbd1de200060a5f3
Author: Houston Putman <[email protected]>
AuthorDate: Thu Feb 20 12:50:49 2025 -0600

    Fix small race condition in DeleteReplicaTest
    
    The CoreContainer will be provided to the jetty after the jetty is
    running. If the test tries to get the cores right after the server is
    ready, it will cause a NullPointerException. So just wait on the cores
    being ready too.
---
 solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java 
b/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java
index 7984ca47e76..63fe4929af0 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java
@@ -504,7 +504,7 @@ public class DeleteReplicaTest extends SolrCloudTestCase {
   private void waitForJettyInit(JettySolrRunner replica1Jetty, String 
replica1JettyNodeName)
       throws InterruptedException {
     TimeOut timeOut = new TimeOut(5, TimeUnit.SECONDS, TimeSource.NANO_TIME);
-    while (!replica1Jetty.isRunning()) {
+    while (!replica1Jetty.isRunning() || replica1Jetty.getCoreContainer() == 
null) {
       Thread.sleep(100);
       if (timeOut.hasTimedOut())
         fail("Wait for " + replica1JettyNodeName + " replica to init failed!");

Reply via email to