From 4a55c86b5ccee6e9c8e8dce4cd28d7dafe5ff6ce Mon Sep 17 00:00:00 2001 From: Yonik Seeley Date: Sat, 17 Oct 2009 16:20:41 +0000 Subject: [PATCH] try to catch what's causing failures in TestLBHttpSolrServer - fail immediately if we can't grab the requested port git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@826277 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/solr/client/solrj/TestLBHttpSolrServer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); }