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); }