You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2014/07/24 07:15:29 UTC
svn commit: r1612999 - in /lucene/dev/trunk/solr: CHANGES.txt
core/src/test/org/apache/solr/cloud/MultiThreadedOCPTest.java
Author: shalin
Date: Thu Jul 24 05:15:29 2014
New Revision: 1612999
URL: http://svn.apache.org/r1612999
Log:
SOLR-6270: Increased timeouts for MultiThreadedOCPTest
Modified:
lucene/dev/trunk/solr/CHANGES.txt
lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/MultiThreadedOCPTest.java
Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1612999&r1=1612998&r2=1612999&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Thu Jul 24 05:15:29 2014
@@ -281,6 +281,8 @@ Other Changes
* SOLR-3345: BaseDistributedSearchTestCase should always ignore QTime.
(Vamsee Yarlagadda, Benson Margulies via Mark Miller)
+* SOLR-6270: Increased timeouts for MultiThreadedOCPTest. (shalin)
+
================== 4.9.0 ==================
Versions of Major Components
Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/MultiThreadedOCPTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/MultiThreadedOCPTest.java?rev=1612999&r1=1612998&r2=1612999&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/MultiThreadedOCPTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/MultiThreadedOCPTest.java Thu Jul 24 05:15:29 2014
@@ -34,17 +34,18 @@ import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.Random;
+import java.util.concurrent.TimeUnit;
/**
* Tests the Multi threaded Collections API.
*/
public class MultiThreadedOCPTest extends AbstractFullDistribZkTestBase {
- private static final int REQUEST_STATUS_TIMEOUT = 90;
+ private static final int REQUEST_STATUS_TIMEOUT = 5 * 60;
private static Logger log = LoggerFactory
.getLogger(MultiThreadedOCPTest.class);
- private static int NUM_COLLECTIONS = 4;
+ private static final int NUM_COLLECTIONS = 4;
@Before
@Override
@@ -151,7 +152,7 @@ public class MultiThreadedOCPTest extend
CollectionAdminRequest.splitShard("ocptest_shardsplit2", SHARD1, server, "3001");
CollectionAdminRequest.splitShard("ocptest_shardsplit2", SHARD2, server, "3002");
- // Now submit another task with the same id. At this time, hopefully the previous 2002 should still be in the queue.
+ // Now submit another task with the same id. At this time, hopefully the previous 3002 should still be in the queue.
CollectionAdminResponse response = CollectionAdminRequest.splitShard("ocptest_shardsplit2", SHARD1, server, "3002");
NamedList r = response.getResponse();
assertEquals("Duplicate request was supposed to exist but wasn't found. De-duplication of submitted task failed.",
@@ -225,7 +226,9 @@ public class MultiThreadedOCPTest extend
private String getRequestStateAfterCompletion(String requestId, int waitForSeconds, SolrServer server)
throws IOException, SolrServerException {
String state = null;
- while(waitForSeconds-- > 0) {
+ long maxWait = System.nanoTime() + TimeUnit.NANOSECONDS.convert(waitForSeconds, TimeUnit.SECONDS);
+
+ while (System.nanoTime() < maxWait) {
state = getRequestState(requestId, server);
if(state.equals("completed") || state.equals("failed"))
return state;
@@ -234,6 +237,7 @@ public class MultiThreadedOCPTest extend
} catch (InterruptedException e) {
}
}
+
return state;
}