From f2f70a415a55463ab0466ce3225bc7ec90a57fa1 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Thu, 1 Aug 2013 15:40:04 +0200 Subject: [PATCH] Take fragile test out of the loop UpdateNumberOfReplicasTests#simpleUpdateNumberOfReplicasTests is very fragile due to executing searches based on dated knowledge of the cluster state and calling shards that have been relocating away in the mean time. A fix is on the way. --- .../settings/UpdateNumberOfReplicasTests.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/test/java/org/elasticsearch/test/integration/indices/settings/UpdateNumberOfReplicasTests.java b/src/test/java/org/elasticsearch/test/integration/indices/settings/UpdateNumberOfReplicasTests.java index 5cac2d1c4b4..549bc6dc7d6 100644 --- a/src/test/java/org/elasticsearch/test/integration/indices/settings/UpdateNumberOfReplicasTests.java +++ b/src/test/java/org/elasticsearch/test/integration/indices/settings/UpdateNumberOfReplicasTests.java @@ -19,6 +19,7 @@ package org.elasticsearch.test.integration.indices.settings; +import org.apache.lucene.util.LuceneTestCase.AwaitsFix; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus; import org.elasticsearch.action.count.CountResponse; @@ -37,7 +38,23 @@ import static org.hamcrest.Matchers.equalTo; */ public class UpdateNumberOfReplicasTests extends AbstractSharedClusterTest { + + /* + * Comment from Boaz on the dev@ list: + * + * A short update on the failing + * UpdateNumberOfReplicasTest.simpleUpdateNumberOfReplicasTests - Shay and I + * pinned down the source of the problem - it's caused by making searches + * based on dated knowledge of the cluster state and calling shards that + * have been relocating away in the mean time. + * + * I'll be working on a a fix (when searching on a shard that is in the + * process of relocating, fail over to the relocation target if the search + * to the relocation source failed), but will it take a couple of days to + * complete. + */ @Test + @AwaitsFix(bugUrl = "Boaz is on it ;)") public void simpleUpdateNumberOfReplicasTests() throws Exception { logger.info("Creating index test"); prepareCreate("test", 2).execute().actionGet();