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@69ca214677f1a2362528392d3b3569fdecd1cb99
@@ -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();
