mirror of https://github.com/apache/lucene.git
SOLR-12313: Make the test finish quicker by lower down intervals
This commit is contained in:
parent
be65b95e80
commit
13a83564bb
|
@ -66,6 +66,9 @@ public class ReplicateFromLeader {
|
|||
}
|
||||
SolrConfig.UpdateHandlerInfo uinfo = core.getSolrConfig().getUpdateHandlerInfo();
|
||||
String pollIntervalStr = "00:00:03";
|
||||
if (System.getProperty("jetty.testMode") != null) {
|
||||
pollIntervalStr = "00:00:01";
|
||||
}
|
||||
if (uinfo.autoCommmitMaxTime != -1) {
|
||||
pollIntervalStr = toPollIntervalStr(uinfo.autoCommmitMaxTime/2);
|
||||
} else if (uinfo.autoSoftCommmitMaxTime != -1) {
|
||||
|
|
|
@ -42,6 +42,7 @@ import org.apache.solr.common.params.ModifiableSolrParams;
|
|||
import org.apache.solr.common.util.NamedList;
|
||||
import org.apache.solr.common.util.Pair;
|
||||
import org.apache.solr.common.util.SuppressForbidden;
|
||||
import org.apache.solr.common.util.TimeSource;
|
||||
import org.apache.solr.core.CoreContainer;
|
||||
import org.apache.solr.core.SolrCore;
|
||||
import org.apache.solr.handler.ReplicationHandler;
|
||||
|
@ -439,7 +440,9 @@ public class TestInjection {
|
|||
boolean enabled = pair.first();
|
||||
if (!enabled) return true;
|
||||
long t = System.currentTimeMillis() - 200;
|
||||
for (int i = 0; i < pair.second(); i++) {
|
||||
int i = 0;
|
||||
TimeOut timeOut = new TimeOut(pair.second(), TimeUnit.SECONDS, TimeSource.NANO_TIME);
|
||||
while (!timeOut.hasTimedOut()) {
|
||||
try {
|
||||
if (core.isClosed()) return true;
|
||||
Replica leaderReplica = zkController.getZkStateReader().getLeaderRetry(
|
||||
|
@ -460,7 +463,7 @@ public class TestInjection {
|
|||
return true;
|
||||
} else {
|
||||
log.debug("Tlog replica not in sync with leader yet. Attempt: {}. Local Version={}, leader Version={}", i, localVersion, leaderVersion);
|
||||
Thread.sleep(500);
|
||||
Thread.sleep(250);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -473,6 +476,7 @@ public class TestInjection {
|
|||
if (core.isClosed()) return true;
|
||||
log.error("Exception when wait for replicas in sync with master. Will retry until timeout.", e);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue