Test: change assertion to make sense
Original commit: elastic/x-pack-elasticsearch@8f01dcff03
This commit is contained in:
parent
4363acb09b
commit
b76b0e7129
|
@ -37,6 +37,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
||||||
import static org.elasticsearch.index.query.QueryBuilders.termQuery;
|
import static org.elasticsearch.index.query.QueryBuilders.termQuery;
|
||||||
import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource;
|
import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource;
|
||||||
|
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
|
||||||
import static org.hamcrest.Matchers.is;
|
import static org.hamcrest.Matchers.is;
|
||||||
import static org.hamcrest.core.IsEqual.equalTo;
|
import static org.hamcrest.core.IsEqual.equalTo;
|
||||||
|
|
||||||
|
@ -107,9 +108,6 @@ public class BootStrapTest extends AbstractAlertingTests {
|
||||||
.get();
|
.get();
|
||||||
assertTrue(indexResponse.isCreated());
|
assertTrue(indexResponse.isCreated());
|
||||||
|
|
||||||
// The executor doesn't get shutdown when alerts stops, so the largest queue size don't get reset.
|
|
||||||
long previousLargestQueueSize = response.getAlertActionManagerLargestQueueSize();
|
|
||||||
|
|
||||||
stopAlerting();
|
stopAlerting();
|
||||||
startAlerting();
|
startAlerting();
|
||||||
|
|
||||||
|
@ -117,7 +115,7 @@ public class BootStrapTest extends AbstractAlertingTests {
|
||||||
assertTrue(response.isAlertActionManagerStarted());
|
assertTrue(response.isAlertActionManagerStarted());
|
||||||
assertThat(response.getAlertManagerStarted(), equalTo(AlertsService.State.STARTED));
|
assertThat(response.getAlertManagerStarted(), equalTo(AlertsService.State.STARTED));
|
||||||
assertThat(response.getNumberOfRegisteredAlerts(), equalTo(1L));
|
assertThat(response.getNumberOfRegisteredAlerts(), equalTo(1L));
|
||||||
assertThat(response.getAlertActionManagerLargestQueueSize() - previousLargestQueueSize, equalTo(1L));
|
assertThat(response.getAlertActionManagerLargestQueueSize(), greaterThanOrEqualTo(1l));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue