Tests: log when an ensure green/yellow comes back

Also added some trace logging to SimpleRecoveryLocalGatewayTests
This commit is contained in:
Boaz Leskes 2014-09-10 14:41:07 +02:00
parent fc89316b1b
commit 09db2e2a27
2 changed files with 4 additions and 1 deletions

View File

@ -25,7 +25,6 @@ import org.elasticsearch.action.admin.indices.recovery.ShardRecoveryResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator;
import org.elasticsearch.cluster.routing.allocation.decider.DisableAllocationDecider;
import org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider;
import org.elasticsearch.common.settings.ImmutableSettings;
import org.elasticsearch.common.settings.Settings;
@ -36,6 +35,7 @@ import org.elasticsearch.indices.recovery.RecoveryState;
import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
import org.elasticsearch.test.InternalTestCluster.RestartCallback;
import org.elasticsearch.test.junit.annotations.TestLogging;
import org.elasticsearch.test.store.MockDirectoryHelper;
import org.junit.Test;
@ -54,6 +54,7 @@ import static org.hamcrest.Matchers.*;
*/
@ClusterScope(numDataNodes = 0, scope = Scope.TEST)
@Slow
@TestLogging("index.shard.service:TRACE")
public class SimpleRecoveryLocalGatewayTests extends ElasticsearchIntegrationTest {
private ImmutableSettings.Builder settingsBuilder() {

View File

@ -921,6 +921,7 @@ public abstract class ElasticsearchIntegrationTest extends ElasticsearchTestCase
assertThat("timed out waiting for green state", actionGet.isTimedOut(), equalTo(false));
}
assertThat(actionGet.getStatus(), equalTo(ClusterHealthStatus.GREEN));
logger.debug("indices {} are green", indices.length == 0 ? "[_all]" : indices);
return actionGet.getStatus();
}
@ -1041,6 +1042,7 @@ public abstract class ElasticsearchIntegrationTest extends ElasticsearchTestCase
logger.info("ensureYellow timed out, cluster state:\n{}\n{}", client().admin().cluster().prepareState().get().getState().prettyPrint(), client().admin().cluster().preparePendingClusterTasks().get().prettyPrint());
assertThat("timed out waiting for yellow", actionGet.isTimedOut(), equalTo(false));
}
logger.debug("indices {} are yellow", indices.length == 0 ? "[_all]" : indices);
return actionGet.getStatus();
}