From d522156e40df12dd69d226cf23e4f0f4b19fd206 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Fri, 3 Apr 2015 10:26:38 +0200 Subject: [PATCH] Now that automatic refresh interval has been increased to 5m we need to invoke api refreshes from tests. Original commit: elastic/x-pack-elasticsearch@5106e6e21b70264d8c9993c6a70373f676156445 --- .../watcher/test/AbstractWatcherIntegrationTests.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/java/org/elasticsearch/watcher/test/AbstractWatcherIntegrationTests.java b/src/test/java/org/elasticsearch/watcher/test/AbstractWatcherIntegrationTests.java index 84e720b7620..494aa7dae81 100644 --- a/src/test/java/org/elasticsearch/watcher/test/AbstractWatcherIntegrationTests.java +++ b/src/test/java/org/elasticsearch/watcher/test/AbstractWatcherIntegrationTests.java @@ -338,6 +338,7 @@ public abstract class AbstractWatcherIntegrationTests extends ElasticsearchInteg assertThat(routingTable.allPrimaryShardsActive(), is(true)); } + refresh(); SearchResponse searchResponse = client().prepareSearch(HistoryStore.INDEX_PREFIX + "*") .setIndicesOptions(IndicesOptions.lenientExpandOpen()) .setQuery(boolQuery().must(matchQuery("watch_name", watchName)).must(matchQuery("state", WatchRecord.State.EXECUTED.id()))) @@ -351,6 +352,7 @@ public abstract class AbstractWatcherIntegrationTests extends ElasticsearchInteg } protected long findNumberOfPerformedActions(String watchName) { + refresh(); SearchResponse searchResponse = client().prepareSearch(HistoryStore.INDEX_PREFIX + "*") .setIndicesOptions(IndicesOptions.lenientExpandOpen()) .setQuery(boolQuery().must(matchQuery("watch_name", watchName)).must(matchQuery("state", WatchRecord.State.EXECUTED.id()))) @@ -372,6 +374,7 @@ public abstract class AbstractWatcherIntegrationTests extends ElasticsearchInteg assertThat(routingTable.allPrimaryShardsActive(), is(true)); } + refresh(); SearchResponse searchResponse = client().prepareSearch(HistoryStore.INDEX_PREFIX + "*") .setIndicesOptions(IndicesOptions.lenientExpandOpen()) .setQuery(boolQuery().must(matchQuery("watch_name", watchName)).must(matchQuery("state", WatchRecord.State.EXECUTION_NOT_NEEDED.id())))