From 462336c13566cfa13414e8cd400a000d58297455 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Tue, 28 Oct 2014 18:20:30 -0400 Subject: [PATCH] Test: fix test to optimize and flush in the end to try to prevent 'Delete Index failed - not acked' --- .../indices/settings/UpdateSettingsTests.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/elasticsearch/indices/settings/UpdateSettingsTests.java b/src/test/java/org/elasticsearch/indices/settings/UpdateSettingsTests.java index 074d7c83aae..55722e21b08 100644 --- a/src/test/java/org/elasticsearch/indices/settings/UpdateSettingsTests.java +++ b/src/test/java/org/elasticsearch/indices/settings/UpdateSettingsTests.java @@ -215,7 +215,7 @@ public class UpdateSettingsTests extends ElasticsearchIntegrationTest { // Optimize does a waitForMerges, which we must do to make sure all in-flight (throttled) merges finish: logger.info("test: optimize"); - client().admin().indices().prepareOptimize("test").get(); + client().admin().indices().prepareOptimize("test").setWaitForMerge(true).get(); logger.info("test: optimize done"); // Record current throttling so far @@ -249,6 +249,13 @@ public class UpdateSettingsTests extends ElasticsearchIntegrationTest { // No additional merge IO throttling should have happened: assertEquals(sumThrottleTime, newSumThrottleTime); + // Optimize & flush and wait; else we sometimes get a "Delete Index failed - not acked" + // when ElasticsearchIntegrationTest.after tries to remove indices created by the test: + + // Wait for merges to finish + client().admin().indices().prepareOptimize("test").setWaitForMerge(true).get(); + flush(); + logger.info("test: test done"); }