Now that automatic refresh interval has been increased to 5m we need to invoke api refreshes from tests.

Original commit: elastic/x-pack-elasticsearch@5106e6e21b
This commit is contained in:
Martijn van Groningen 2015-04-03 10:26:38 +02:00
parent 500b86577e
commit d522156e40
1 changed files with 3 additions and 0 deletions

View File

@ -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())))