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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]