add a recovery test while under indexing load

This commit is contained in:
kimchy 2010-07-18 23:57:57 +03:00
parent 9c9dfe0b39
commit f9cd7cb932
1 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,7 @@
package org.elasticsearch.test.integration.recovery; package org.elasticsearch.test.integration.recovery;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus;
import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.collect.MapBuilder;
import org.elasticsearch.test.integration.AbstractNodesTests; import org.elasticsearch.test.integration.AbstractNodesTests;
import org.testng.annotations.AfterMethod; import org.testng.annotations.AfterMethod;
@ -83,6 +84,9 @@ public class RecoveryWhileUnderLoadTests extends AbstractNodesTests {
// now start another node, while we index // now start another node, while we index
startNode("server2"); startNode("server2");
// make sure the cluster state is green, and all has been recovered
assertThat(client("server1").admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet().status(), equalTo(ClusterHealthStatus.GREEN));
// wait till we index 10,0000 // wait till we index 10,0000
while (client("server1").prepareCount().setQuery(matchAllQuery()).execute().actionGet().count() < 10000) { while (client("server1").prepareCount().setQuery(matchAllQuery()).execute().actionGet().count() < 10000) {