mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-02 00:49:11 +00:00
Tests: restart the action manager between tests.
Original commit: elastic/x-pack-elasticsearch@73bc51717b
This commit is contained in:
parent
98bb60e4ba
commit
4eca3c86a0
@ -216,9 +216,9 @@ public class AlertManager extends AbstractComponent {
|
||||
* For testing only to clear the alerts and actions between tests.
|
||||
*/
|
||||
public void clear() {
|
||||
scheduler.clearAlerts();
|
||||
scheduler.clear();
|
||||
alertsStore.clear();
|
||||
actionManager.clear();
|
||||
actionManager.restart();
|
||||
}
|
||||
|
||||
private void internalStop() {
|
||||
|
@ -140,7 +140,7 @@ public class AlertsStore extends AbstractComponent {
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the in-memory representation of the alerts
|
||||
* Exists for testing purposes
|
||||
*/
|
||||
public void clear() {
|
||||
alertMap.clear();
|
||||
|
@ -135,8 +135,12 @@ public class AlertActionManager extends AbstractComponent {
|
||||
return started.get();
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
actionsToBeProcessed.clear();
|
||||
/**
|
||||
* Exists for testing purposes.
|
||||
*/
|
||||
public void restart() {
|
||||
stop();
|
||||
doStart();
|
||||
}
|
||||
|
||||
private void doStart() {
|
||||
|
@ -98,7 +98,10 @@ public class AlertScheduler extends AbstractComponent {
|
||||
}
|
||||
}
|
||||
|
||||
public void clearAlerts() {
|
||||
/**
|
||||
* Exists for testing purposes
|
||||
*/
|
||||
public void clear() {
|
||||
try {
|
||||
if (scheduler != null) {
|
||||
scheduler.clear();
|
||||
|
Loading…
x
Reference in New Issue
Block a user