SOLR-12801: Fix TestSolrCloudWithKerberosAlt.

This commit is contained in:
markrmiller 2018-12-10 11:46:27 -06:00
parent b6cbb8494e
commit d96475a0bb
2 changed files with 4 additions and 2 deletions

View File

@ -64,7 +64,6 @@ public class KerberosTestServices {
Locale.setDefault(Locale.US);
}
File dir = null;
// There is time lag between selecting a port and trying to bind with it. It's possible that
// another service captures the port in between which'll result in BindException.
boolean bindException;
@ -76,7 +75,7 @@ public class KerberosTestServices {
kdc = getKdc(workDir);
kdc.start();
} catch (BindException e) {
FileUtils.deleteDirectory(dir); // clean directory
FileUtils.deleteDirectory(workDir); // clean directory
numTries++;
if (numTries == 3) {
log.error("Failed setting up MiniKDC. Tried " + numTries + " times.");

View File

@ -21,6 +21,8 @@ import java.lang.invoke.MethodHandles;
import java.nio.charset.StandardCharsets;
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakLingering;
import org.apache.commons.io.FileUtils;
import org.apache.lucene.util.Constants;
import org.apache.lucene.util.LuceneTestCase;
@ -46,6 +48,7 @@ import org.slf4j.LoggerFactory;
})
@LuceneTestCase.Slow
@ThreadLeakLingering(linger = 10000) // minikdc has some lingering threads
public class TestSolrCloudWithKerberosAlt extends SolrCloudTestCase {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());