Skip to content

Commit

Permalink
SOLR-16104: TestCoreDiscovery.testTooManyTransientCores() to use retr…
Browse files Browse the repository at this point in the history
…yUntil logic (apache#772)

Co-authored-by: David Smiley <[email protected]>
  • Loading branch information
cpoerschke and dsmiley authored May 27, 2022
1 parent 6e53163 commit d3e9779
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions solr/core/src/test/org/apache/solr/core/TestCoreDiscovery.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@
import java.nio.file.Paths;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import org.apache.commons.io.FileUtils;
import org.apache.lucene.util.IOUtils;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.util.RetryUtil;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Test;
Expand Down Expand Up @@ -327,10 +329,12 @@ public void testTooManyTransientCores() throws Exception {
cc.load();
// Just check that the proper number of cores are loaded since making the test depend on order
// would be fragile
assertEquals(
RetryUtil.retryUntil(
"There should only be 3 cores loaded, coreLOS and two coreT? cores",
3,
cc.getLoadedCoreNames().size());
5,
200,
TimeUnit.MILLISECONDS,
() -> 3 == cc.getLoadedCoreNames().size());

SolrCore c1 = cc.getCore("coreT1");
assertNotNull("Core T1 should NOT BE NULL", c1);
Expand Down

0 comments on commit d3e9779

Please sign in to comment.