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@cf20d58b0b
This commit is contained in:
Alexander Reelsen 2018-01-26 11:14:14 +01:00
parent 2356830782
commit 49ecd23eb9
1 changed files with 1 additions and 0 deletions

View File

@ -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 // now we restart, to make sure the watches and their secrets are reloaded from the index properly
assertAcked(watcherClient.prepareWatchService().stop().get()); assertAcked(watcherClient.prepareWatchService().stop().get());
ensureWatcherStopped();
assertAcked(watcherClient.prepareWatchService().start().get()); assertAcked(watcherClient.prepareWatchService().start().get());
ensureWatcherStarted(); ensureWatcherStarted();