Tests: clean search scroll at the end of SearchCancellationIT

Under some rare conditions search cancellation response might not fully clean scroll context. For now this commit adds the cleaning operation to the test, and we will address the root cause in https://github.com/elastic/elasticsearch/issues/21511
This commit is contained in:
Igor Motov 2016-11-11 16:24:22 -05:00
parent 1fde26347a
commit 058b6e019c
1 changed files with 6 additions and 1 deletions

View File

@ -193,7 +193,12 @@ public class SearchCancellationIT extends ESIntegTestCase {
awaitForBlock(plugins);
cancelSearch(SearchAction.NAME);
disableBlocks(plugins);
ensureSearchWasCancelled(searchResponse);
SearchResponse response = ensureSearchWasCancelled(searchResponse);
if (response != null) {
// The response might not have failed on all shards - we need to clean scroll
logger.info("Cleaning scroll with id {}", response.getScrollId());
client().prepareClearScroll().addScrollId(response.getScrollId()).get();
}
}