Skip to content

Apache Lucene open-source search software

fix hangs/fails in test for certain name service configs

Yonik Seeleyc968a41ef647
diff --git a/src/test/org/apache/solr/client/solrj/SolrExceptionTest.java b/src/test/org/apache/solr/client/solrj/SolrExceptionTest.java
index b83a2919a3a..d37d9cf0878 100644
--- a/src/test/org/apache/solr/client/solrj/SolrExceptionTest.java
+++ b/src/test/org/apache/solr/client/solrj/SolrExceptionTest.java
@@ -38,14 +38,17 @@ public class SolrExceptionTest extends TestCase {
// if the compiler won't let you by without the try/catch
boolean gotExpectedError = false;
try {
- SolrServer client = new CommonsHttpSolrServer("http://333.333.333.333:8080/solr/");
+ // switched to a local address to avoid going out on the net, ns lookup issues, etc.
+ SolrServer client = new CommonsHttpSolrServer("http://localhost:11235/solr/");
SolrQuery query = new SolrQuery("test123");
client.query(query);
} catch (SolrServerException sse) {
gotExpectedError = true;
+ /***
assertTrue(UnknownHostException.class == sse.getRootCause().getClass()
//If one is using OpenDNS, then you don't get UnknownHostException, instead you get back that the query couldn't execute
|| (sse.getRootCause().getClass() == SolrException.class && ((SolrException) sse.getRootCause()).code() == 302 && sse.getMessage().equals("Error executing query")));
+ ***/
}
assertTrue(gotExpectedError);
}