diff --git a/src/main/java/org/elasticsearch/alerts/AlertManager.java b/src/main/java/org/elasticsearch/alerts/AlertManager.java index 03bbe5ad8b1..59ee95342fa 100644 --- a/src/main/java/org/elasticsearch/alerts/AlertManager.java +++ b/src/main/java/org/elasticsearch/alerts/AlertManager.java @@ -216,9 +216,9 @@ public class AlertManager extends AbstractComponent { * For testing only to clear the alerts and actions between tests. */ public void clear() { + actionManager.restart(); scheduler.clear(); alertsStore.clear(); - actionManager.restart(); } private void internalStop() { diff --git a/src/main/java/org/elasticsearch/alerts/AlertsStore.java b/src/main/java/org/elasticsearch/alerts/AlertsStore.java index 192bc9dd70b..f8d23242d04 100644 --- a/src/main/java/org/elasticsearch/alerts/AlertsStore.java +++ b/src/main/java/org/elasticsearch/alerts/AlertsStore.java @@ -119,7 +119,7 @@ public class AlertsStore extends AbstractComponent { private boolean verifySameInstance(Alert alert) { Alert found = alertMap.get(alert.alertName()); - assert found == alert : "expected " + alert + " but got" + found; + assert found == alert : "expected " + alert + " but got " + found; return true; } diff --git a/src/test/java/org/elasticsearch/alerts/NoMasterNodeTests.java b/src/test/java/org/elasticsearch/alerts/NoMasterNodeTests.java index 12821344764..322a003f661 100644 --- a/src/test/java/org/elasticsearch/alerts/NoMasterNodeTests.java +++ b/src/test/java/org/elasticsearch/alerts/NoMasterNodeTests.java @@ -90,6 +90,7 @@ public class NoMasterNodeTests extends AbstractAlertingTests { public void testMultipleFailures() throws Exception { int numberOfFailures = scaledRandomIntBetween(2, 9); int numberOfAlerts = scaledRandomIntBetween(numberOfFailures, 12); + logger.info("Number of failures [{}], number of alerts [{}]", numberOfFailures, numberOfAlerts); config = new ClusterDiscoveryConfiguration.UnicastZen(2 + numberOfFailures); internalTestCluster().startNodesAsync(2).get(); createIndex("my-index");