[TEST] Ensure the license is enabled when starting watcher

This change adds a check to make sure that the license is enabled when starting watcher in the tests.
This avoids a race-condition where a test might run before the license manager had a chance to start.

Original commit: elastic/x-pack-elasticsearch@0b9d0da5d4
This commit is contained in:
Brian Murphy 2015-05-12 12:29:56 -04:00
parent 54926ec336
commit 7c1497ae3b
1 changed files with 1 additions and 0 deletions

View File

@ -188,6 +188,7 @@ public abstract class AbstractWatcherIntegrationTests extends ElasticsearchInteg
private void startWatcherIfNodesExist() throws Exception {
if (internalTestCluster().size() > 0) {
ensureLicenseEnabled();
WatcherStatsResponse response = watcherClient().prepareWatcherStats().get();
if (response.getWatcherState() == WatcherState.STOPPED) {
logger.info("[{}#{}]: starting watcher", getTestClass().getSimpleName(), getTestName());