[Test] added trace logging to refresh action to note which cluster version was used

Increase logging level for SearchWithRandomExceptionsTests.testRandomExceptions & MinDocCountTests to use the above and log cluster states on changes.
This commit is contained in:
Boaz Leskes 2014-04-04 13:17:28 +02:00
parent f582212c68
commit 940954bfd1
3 changed files with 5 additions and 0 deletions

View File

@ -122,6 +122,7 @@ public class TransportRefreshAction extends TransportBroadcastOperationAction<Re
*/ */
@Override @Override
protected GroupShardsIterator shards(ClusterState clusterState, RefreshRequest request, String[] concreteIndices) { protected GroupShardsIterator shards(ClusterState clusterState, RefreshRequest request, String[] concreteIndices) {
logger.trace("resolving shards to refresh based on cluster state version [{}]", clusterState.version());
return clusterState.routingTable().allAssignedShardsGrouped(concreteIndices, true); return clusterState.routingTable().allAssignedShardsGrouped(concreteIndices, true);
} }

View File

@ -33,6 +33,7 @@ import org.elasticsearch.search.aggregations.bucket.histogram.Histogram;
import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.elasticsearch.search.aggregations.bucket.terms.TermsBuilder; import org.elasticsearch.search.aggregations.bucket.terms.TermsBuilder;
import org.elasticsearch.test.ElasticsearchIntegrationTest; import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.elasticsearch.test.junit.annotations.TestLogging;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormat;
@ -46,6 +47,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAllS
@ElasticsearchIntegrationTest.SuiteScopeTest @ElasticsearchIntegrationTest.SuiteScopeTest
@TestLogging("action.admin.indices.refresh:TRACE,action.search.type:TRACE,cluster.service:TRACE")
public class MinDocCountTests extends ElasticsearchIntegrationTest { public class MinDocCountTests extends ElasticsearchIntegrationTest {
private static final QueryBuilder QUERY = QueryBuilders.termQuery("match", true); private static final QueryBuilder QUERY = QueryBuilders.termQuery("match", true);

View File

@ -38,6 +38,7 @@ import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.elasticsearch.test.ImmutableTestCluster; import org.elasticsearch.test.ImmutableTestCluster;
import org.elasticsearch.test.engine.MockInternalEngine; import org.elasticsearch.test.engine.MockInternalEngine;
import org.elasticsearch.test.engine.ThrowingAtomicReaderWrapper; import org.elasticsearch.test.engine.ThrowingAtomicReaderWrapper;
import org.elasticsearch.test.junit.annotations.TestLogging;
import org.elasticsearch.test.store.MockDirectoryHelper; import org.elasticsearch.test.store.MockDirectoryHelper;
import org.elasticsearch.test.store.MockFSDirectoryService; import org.elasticsearch.test.store.MockFSDirectoryService;
import org.hamcrest.Matchers; import org.hamcrest.Matchers;
@ -187,6 +188,7 @@ public class SearchWithRandomExceptionsTests extends ElasticsearchIntegrationTes
} }
@Test @Test
@TestLogging("action.admin.indices.refresh:TRACE,action.search.type:TRACE,cluster.service:TRACE")
public void testRandomExceptions() throws IOException, InterruptedException, ExecutionException { public void testRandomExceptions() throws IOException, InterruptedException, ExecutionException {
String mapping = XContentFactory.jsonBuilder(). String mapping = XContentFactory.jsonBuilder().
startObject(). startObject().