From 898430be9b81d7733f063c0ca71c288502281696 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Sun, 18 Jul 2010 14:09:06 +0000 Subject: [PATCH] SOLR-2002: add timeouts for this test in case the site is having problems git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@965230 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/solr/servlet/SolrRequestParserTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/solr/src/test/org/apache/solr/servlet/SolrRequestParserTest.java b/solr/src/test/org/apache/solr/servlet/SolrRequestParserTest.java index f8d46536388..337ee700bf5 100644 --- a/solr/src/test/org/apache/solr/servlet/SolrRequestParserTest.java +++ b/solr/src/test/org/apache/solr/servlet/SolrRequestParserTest.java @@ -22,6 +22,7 @@ import static org.easymock.EasyMock.expect; import static org.easymock.EasyMock.replay; import java.net.URL; +import java.net.URLConnection; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -111,7 +112,11 @@ public class SolrRequestParserTest extends SolrTestCaseJ4 { String url = "http://www.apache.org/dist/lucene/solr/"; String txt = null; try { - txt = IOUtils.toString( new URL(url).openStream() ); + URLConnection connection = new URL(url).openConnection(); + connection.setConnectTimeout(5000); + connection.setReadTimeout(5000); + connection.connect(); + txt = IOUtils.toString( connection.getInputStream()); } catch( Exception ex ) { // TODO - should it fail/skip?