test: also wait for paused state
Original commit: elastic/x-pack-elasticsearch@8ffec23a21
This commit is contained in:
parent
2b2307a82b
commit
0cba57194c
|
@ -264,13 +264,15 @@ public class PrelertJobIT extends ESRestTestCase {
|
||||||
client().performRequest("post", PrelertPlugin.BASE_PATH + "jobs/farequote/_pause");
|
client().performRequest("post", PrelertPlugin.BASE_PATH + "jobs/farequote/_pause");
|
||||||
assertBusy(() -> {
|
assertBusy(() -> {
|
||||||
try {
|
try {
|
||||||
Response response = client().performRequest("get", PrelertPlugin.BASE_PATH + "jobs/farequote");
|
Response response = client().performRequest("get", PrelertPlugin.BASE_PATH + "jobs/farequote",
|
||||||
|
Collections.singletonMap("metric", "config,status"));
|
||||||
String responseEntityToString = responseEntityToString(response);
|
String responseEntityToString = responseEntityToString(response);
|
||||||
assertThat(responseEntityToString, containsString("\"ignoreDowntime\":\"ONCE\""));
|
assertThat(responseEntityToString, containsString("\"ignoreDowntime\":\"ONCE\""));
|
||||||
|
assertThat(responseEntityToString, containsString("\"status\":\"PAUSED\""));
|
||||||
} catch (Exception e1) {
|
} catch (Exception e1) {
|
||||||
fail();
|
fail();
|
||||||
}
|
}
|
||||||
}, 2, TimeUnit.SECONDS);
|
});
|
||||||
|
|
||||||
e = expectThrows(ResponseException.class,
|
e = expectThrows(ResponseException.class,
|
||||||
() -> client().performRequest("post", PrelertPlugin.BASE_PATH + "jobs/farequote/_pause"));
|
() -> client().performRequest("post", PrelertPlugin.BASE_PATH + "jobs/farequote/_pause"));
|
||||||
|
|
Loading…
Reference in New Issue