From 49ecd23eb908e68ee49b5d87d7d1cb77c6de27b6 Mon Sep 17 00:00:00 2001 From: Alexander Reelsen Date: Fri, 26 Jan 2018 11:14:14 +0100 Subject: [PATCH] Tests: Ensure watcher is stopped before restarting The EmailSecretsIntegrationTests did not properly wait for watcher to be stopped before starting it again. This test failed a few times per week across master and 6.x branches. Original commit: elastic/x-pack-elasticsearch@cf20d58b0b0fe5de3768f1456510c9d47b989504 --- .../watcher/notification/email/EmailSecretsIntegrationTests.java | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/EmailSecretsIntegrationTests.java b/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/EmailSecretsIntegrationTests.java index 6dab68539d7..b5e229ff9f9 100644 --- a/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/EmailSecretsIntegrationTests.java +++ b/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/EmailSecretsIntegrationTests.java @@ -123,6 +123,7 @@ public class EmailSecretsIntegrationTests extends AbstractWatcherIntegrationTest // now we restart, to make sure the watches and their secrets are reloaded from the index properly assertAcked(watcherClient.prepareWatchService().stop().get()); + ensureWatcherStopped(); assertAcked(watcherClient.prepareWatchService().start().get()); ensureWatcherStarted();