瀏覽代碼

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.
Nik Everett 9 年之前
父節點
當前提交
39d8f5f123

+ 5 - 1
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;
             }
         }