From 4ca514f18c4982a2f6cbafab78948fcbfd619dcb Mon Sep 17 00:00:00 2001 From: Mayya Sharipova Date: Tue, 26 Feb 2019 11:53:38 -0500 Subject: [PATCH] Fix testCacheWithFilteredAlias failure (#39401) Move refresh after Forcemerge Relates to #32827 --- .../java/org/elasticsearch/indices/IndicesRequestCacheIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/test/java/org/elasticsearch/indices/IndicesRequestCacheIT.java b/server/src/test/java/org/elasticsearch/indices/IndicesRequestCacheIT.java index 7e13b38fd3d..90909b1c201 100644 --- a/server/src/test/java/org/elasticsearch/indices/IndicesRequestCacheIT.java +++ b/server/src/test/java/org/elasticsearch/indices/IndicesRequestCacheIT.java @@ -386,10 +386,10 @@ public class IndicesRequestCacheIT extends ESIntegTestCase { ZonedDateTime now = ZonedDateTime.now(ZoneOffset.UTC); client.prepareIndex("index", "type", "1").setRouting("1").setSource("created_at", DateTimeFormatter.ISO_LOCAL_DATE.format(now)).get(); - refresh(); // Force merge the index to ensure there can be no background merges during the subsequent searches that would invalidate the cache ForceMergeResponse forceMergeResponse = client.admin().indices().prepareForceMerge("index").setFlush(true).get(); ElasticsearchAssertions.assertAllSuccessful(forceMergeResponse); + refresh(); assertCacheState(client, "index", 0, 0);