You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "epugh (via GitHub)" <gi...@apache.org> on 2026/05/02 14:15:40 UTC

[PR] fix ci flakiness leaderelection test [solr]

epugh opened a new pull request, #4388:
URL: https://github.com/apache/solr/pull/4388

   I found this while running some tests on Crave:
   
   ```
   ./gradlew :solr:core:test --tests "org.apache.solr.cloud.LeaderElectionIntegrationTest.testSimpleSliceLeaderElection" "-Ptests.jvmargs=-XX:TieredStopAtLevel=1 -XX:+UseParallelGC -XX:ActiveProcessorCount=1 -XX:ReservedCodeCacheSize=120m" -Ptests.seed=F08428E6CA23E0C6 -Ptests.timeoutSuite=600000! -Ptests.useSecurityManager=true -Ptests.file.encoding=UTF-8
   
   ```
   
   I asked for a tip from copilot on what was failing, and this is what it gave me.  I *believe* that I've basically seen this same timing fix proposed on other flaky tests..
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] fix ci flakiness leaderelection test [solr]

Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh merged PR #4388:
URL: https://github.com/apache/solr/pull/4388


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] fix ci flakiness leaderelection test [solr]

Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh commented on code in PR #4388:
URL: https://github.com/apache/solr/pull/4388#discussion_r3176744215


##########
solr/core/src/test/org/apache/solr/cloud/LeaderElectionIntegrationTest.java:
##########
@@ -61,7 +61,7 @@ public void testSimpleSliceLeaderElection() throws Exception {
     String collection = "collection1";
     createCollection(collection);
 
-    cluster.waitForActiveCollection(collection, 10, TimeUnit.SECONDS, 2, 6);
+    cluster.waitForActiveCollection(collection, 60, TimeUnit.SECONDS, 2, 6);

Review Comment:
   I believe this is to set an overall upper limit before failing!



##########
solr/core/src/test/org/apache/solr/cloud/LeaderElectionIntegrationTest.java:
##########
@@ -107,15 +107,20 @@ public void testSimpleSliceLeaderElection() throws Exception {
     assertNotNull(jetty);
     cluster.expireZkSession(jetty);
 
-    for (int i = 0; i < 60; i++) { // wait till leader is changed
-      if (jetty != getRunner(getLeader(collection))) {
-        break;
-      }
-      Thread.sleep(100);
-    }
-
-    // make sure we have waited long enough for the first leader to have come back
-    Thread.sleep(ZkTestServer.TICK_TIME * 2 + 100);
+    // Wait until leadership has moved away from the expired-session node

Review Comment:
   I like the waitForState instead of the thread.sleep



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org