Skip to content

Commit

Permalink
Fix Rest Tests Failing to Cleanup Rollup Jobs (#51246) (#51297)
Browse files Browse the repository at this point in the history
* Fix Rest Tests Failing to Cleanup Rollup Jobs

If the rollup jobs index doesn't exist for some reason (like running against a 6.x cluster)
we should just assume the jobs have been cleaned up and move on.

Closes #50819
  • Loading branch information
original-brownbear authored Jan 22, 2020
1 parent a03f62f commit d9cf8fc
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,16 @@ private void wipeClusterSettings() throws IOException {
}

private void wipeRollupJobs() throws IOException {
Response response = adminClient().performRequest(new Request("GET", "/_rollup/job/_all"));
final Response response;
try {
response = adminClient().performRequest(new Request("GET", "/_rollup/job/_all"));
} catch (ResponseException e) {
// If we don't see the rollup endpoint (possibly because of running against an older ES version) we just bail
if (e.getResponse().getStatusLine().getStatusCode() == RestStatus.NOT_FOUND.getStatus()) {
return;
}
throw e;
}
Map<String, Object> jobs = entityAsMap(response);
@SuppressWarnings("unchecked")
List<Map<String, Object>> jobConfigs =
Expand Down

0 comments on commit d9cf8fc

Please sign in to comment.