SOLR-13577: wait jetty to stop as @hossman advised.

This commit is contained in:
Mikhail Khludnev 2019-06-30 09:45:35 +03:00
parent 299bfe55b3
commit 2fdb4dd7d4
1 changed files with 7 additions and 0 deletions

View File

@ -66,6 +66,7 @@ import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.TimeSource;
import org.apache.solr.core.CachingDirectoryFactory;
import org.apache.solr.core.CoreContainer;
import org.apache.solr.core.SolrCore;
@ -73,6 +74,7 @@ import org.apache.solr.core.StandardDirectoryFactory;
import org.apache.solr.core.snapshots.SolrSnapshotMetaDataManager;
import org.apache.solr.util.FileUtils;
import org.apache.solr.util.TestInjection;
import org.apache.solr.util.TimeOut;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
@ -675,6 +677,11 @@ public class TestReplicationHandler extends SolrTestCaseJ4 {
masterJetty.stop();
final TimeOut waitForLeaderToShutdown = new TimeOut(300, TimeUnit.SECONDS, TimeSource.NANO_TIME);
waitForLeaderToShutdown.waitFor
("Gave up after waiting an obscene amount of time for leader to shut down",
() -> masterJetty.isStopped() );
for(int retries=0; ;retries++) {
Thread.yield(); // might not be necessary at all