Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

try to catch what's causing failures in TestLBHttpSolrServer - fail immediately if we can't grab the requested port

Yonik Seeley4a55c86b5cce
diff --git a/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java b/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java
index 01141fcf203..dac3b174755 100644
--- a/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java
+++ b/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java
@@ -224,7 +224,11 @@ public class TestLBHttpSolrServer extends TestCase {
System.setProperty("solr.solr.home", getHomeDir());
System.setProperty("solr.data.dir", getDataDir());
jetty.start();
- this.port = jetty.getLocalPort();
+ int newPort = jetty.getLocalPort();
+ if (port != 0 && newPort != port) {
+ TestCase.fail("TESTING FAILURE: could not grab requested port.");
+ }
+ this.port = newPort;
// System.out.println("waiting.........");
// Thread.sleep(5000);
}