SOLR-6290: Harden and speed up CollectionsAPIAsyncDistributedZkTest

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1614194 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2014-07-28 21:42:52 +00:00
parent 26be35a4a7
commit dcb260ad14
2 changed files with 11 additions and 9 deletions

View File

@ -304,6 +304,8 @@ Other Changes
* SOLR-6231: Increased timeouts and hardened the RollingRestartTest. (Noble Paul, shalin)
* SOLR-6290: Harden and speed up CollectionsAPIAsyncDistributedZkTest. (Mark Miller, shalin)
================== 4.9.0 ==================
Versions of Major Components

View File

@ -34,7 +34,7 @@ import java.io.IOException;
*/
@Slow
public class CollectionsAPIAsyncDistributedZkTest extends AbstractFullDistribZkTestBase {
private static final int MAX_TIMEOUT_SECONDS = 60;
private static final boolean DEBUG = false;
@Before
@ -51,8 +51,8 @@ public class CollectionsAPIAsyncDistributedZkTest extends AbstractFullDistribZkT
public CollectionsAPIAsyncDistributedZkTest() {
fixShardCount = true;
sliceCount = 2;
shardCount = 4;
sliceCount = 1;
shardCount = 1;
}
@Override
@ -67,16 +67,16 @@ public class CollectionsAPIAsyncDistributedZkTest extends AbstractFullDistribZkT
private void testSolrJAPICalls() throws Exception {
SolrServer server = createNewSolrServer("", getBaseUrl((HttpSolrServer) clients.get(0)));
CollectionAdminRequest.createCollection("testasynccollectioncreation", 2, "conf1", server, "1001");
CollectionAdminRequest.createCollection("testasynccollectioncreation", 1, "conf1", server, "1001");
String state = null;
state = getRequestStateAfterCompletion("1001", 10, server);
state = getRequestStateAfterCompletion("1001", MAX_TIMEOUT_SECONDS, server);
assertEquals("CreateCollection task did not complete!", "completed", state);
CollectionAdminRequest.createCollection("testasynccollectioncreation", 2, "conf1", server, "1002");
CollectionAdminRequest.createCollection("testasynccollectioncreation", 1, "conf1", server, "1002");
state = getRequestStateAfterCompletion("1002", 3, server);
state = getRequestStateAfterCompletion("1002", MAX_TIMEOUT_SECONDS, server);
assertEquals("Recreating a collection with the same name didn't fail, should have.", "failed", state);
@ -85,12 +85,12 @@ public class CollectionsAPIAsyncDistributedZkTest extends AbstractFullDistribZkT
addReplica.setShardName("shard1");
addReplica.setAsyncId("1003");
server.request(addReplica);
state = getRequestStateAfterCompletion("1003", 60, server);
state = getRequestStateAfterCompletion("1003", MAX_TIMEOUT_SECONDS, server);
assertEquals("Add replica did not complete", "completed", state);
CollectionAdminRequest.splitShard("testasynccollectioncreation", "shard1", server, "1004");
state = getRequestStateAfterCompletion("1004", 60, server);
state = getRequestStateAfterCompletion("1004", MAX_TIMEOUT_SECONDS * 2, server);
assertEquals("Shard split did not complete. Last recorded state: " + state, "completed", state);
}