From 39d8f5f123ba9b9d3c5b3b32b97a7ab8343189a3 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Wed, 17 Aug 2016 10:25:38 -0400 Subject: [PATCH] Reindex tests should expect the right failure Reindex intentionally tries to fail the search operation to make sure that the exception flows back. The exception message changed so we should catch the appropriate exception. --- .../elasticsearch/index/reindex/ReindexFailureTests.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexFailureTests.java b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexFailureTests.java index 45ac5640221..b81be4a1bb2 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexFailureTests.java +++ b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexFailureTests.java @@ -108,7 +108,11 @@ public class ReindexFailureTests extends ReindexTestCase { attempt++; } catch (ExecutionException e) { logger.info("Triggered a reindex failure on the {} attempt", attempt); - assertThat(e.getMessage(), either(containsString("all shards failed")).or(containsString("No search context found"))); + assertThat(e.getMessage(), + either(containsString("all shards failed")) + .or(containsString("No search context found")) + .or(containsString("no such index")) + ); return; } }