mirror of https://github.com/apache/lucene.git
hack broken test to not waste hours of jenkins time
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1426096 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6cd89df2c1
commit
53caac2cc4
|
@ -124,21 +124,26 @@ public class BasicHttpSolrServerTest extends SolrJettyTestBase {
|
||||||
.addServletWithMapping(DebugServlet.class, "/debug/*");
|
.addServletWithMapping(DebugServlet.class, "/debug/*");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// what is this actually testing? this test WILL randomly fail.
|
||||||
|
// not a good unit test!
|
||||||
@Test
|
@Test
|
||||||
public void testConnectionRefused() throws MalformedURLException {
|
public void testConnectionRefused() throws MalformedURLException {
|
||||||
int unusedPort = findUnusedPort(); // XXX even if fwe found an unused port
|
int unusedPort = findUnusedPort(); // XXX even if fwe found an unused port
|
||||||
// it might not be unused anymore
|
// it might not be unused anymore
|
||||||
HttpSolrServer server = new HttpSolrServer("http://127.0.0.1:" + unusedPort
|
HttpSolrServer server = new HttpSolrServer("http://127.0.0.1:" + unusedPort
|
||||||
+ "/solr");
|
+ "/solr");
|
||||||
|
server.setConnectionTimeout(500);
|
||||||
SolrQuery q = new SolrQuery("*:*");
|
SolrQuery q = new SolrQuery("*:*");
|
||||||
try {
|
try {
|
||||||
QueryResponse response = server.query(q);
|
QueryResponse response = server.query(q);
|
||||||
fail("Should have thrown an exception.");
|
fail("Should have thrown an exception.");
|
||||||
} catch (SolrServerException e) {
|
} catch (SolrServerException e) {
|
||||||
|
assumeFalse("blackholed!", e.getMessage().contains("IOException occured when talking to server"));
|
||||||
assertTrue(e.getMessage().contains("refused"));
|
assertTrue(e.getMessage().contains("refused"));
|
||||||
}
|
} finally {
|
||||||
server.shutdown();
|
server.shutdown();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTimeout() throws Exception {
|
public void testTimeout() throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue