mirror of https://github.com/apache/lucene.git
SOLR-6270: Increased timeouts for MultiThreadedOCPTest
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1612999 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b293b947cb
commit
4b40a46634
|
@ -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
|
||||
|
|
|
@ -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 extends AbstractFullDistribZkTestBase {
|
|||
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 extends AbstractFullDistribZkTestBase {
|
|||
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 extends AbstractFullDistribZkTestBase {
|
|||
} catch (InterruptedException e) {
|
||||
}
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue