From 49f79f54d2d99e12107ad1da77d74dc9b380b0a1 Mon Sep 17 00:00:00 2001 From: kimchy Date: Mon, 28 Mar 2011 18:17:36 +0200 Subject: [PATCH] log when search failure happen when scanning --- .../rollingrestart/RollingRestartStressTest.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/test/integration/src/test/java/org/elasticsearch/test/stress/rollingrestart/RollingRestartStressTest.java b/modules/test/integration/src/test/java/org/elasticsearch/test/stress/rollingrestart/RollingRestartStressTest.java index 91593f6d5dd..aa456a50c44 100644 --- a/modules/test/integration/src/test/java/org/elasticsearch/test/stress/rollingrestart/RollingRestartStressTest.java +++ b/modules/test/integration/src/test/java/org/elasticsearch/test/stress/rollingrestart/RollingRestartStressTest.java @@ -44,12 +44,11 @@ import org.elasticsearch.node.internal.InternalNode; import org.elasticsearch.search.SearchHit; import java.io.File; +import java.util.Arrays; import java.util.concurrent.atomic.AtomicLong; import static org.elasticsearch.common.settings.ImmutableSettings.*; import static org.elasticsearch.index.query.xcontent.QueryBuilders.*; -import static org.hamcrest.MatcherAssert.*; -import static org.hamcrest.Matchers.*; /** * @author kimchy (shay.banon) @@ -189,6 +188,8 @@ public class RollingRestartStressTest { nodes[nodeIndex] = NodeBuilder.nodeBuilder().settings(settings).node(); + Thread.sleep(1000); + try { ClusterHealthResponse clusterHealth = client.client().admin().cluster().prepareHealth() .setWaitForGreenStatus() @@ -258,7 +259,9 @@ public class RollingRestartStressTest { while (true) { searchResponse = client.client().prepareSearchScroll(searchResponse.scrollId()).setScroll(TimeValue.timeValueMinutes(2)).execute().actionGet(); - assertThat(searchResponse.failedShards(), equalTo(0)); + if (searchResponse.failedShards() > 0) { + logger.warn("Search Failures " + Arrays.toString(searchResponse.shardFailures())); + } for (SearchHit hit : searchResponse.hits()) { long version = -1; for (int i = 0; i < (numberOfReplicas + 1); i++) { @@ -351,7 +354,7 @@ public class RollingRestartStressTest { .cleanNodeData(false) .indexers(5) .indexerThrottle(TimeValue.timeValueMillis(50)) - .period(TimeValue.timeValueMinutes(1)); + .period(TimeValue.timeValueMinutes(3)); test.run(); }