Add extra debugging to reindex cancel tests

Adds more diagnostics when reindex's cancel tests fail. It fails
every once in a while and didn't have useful failure messages:
https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+5.3+multijob-unix-compatibility/os=amazon/86/consoleFull
This commit is contained in:
Nik Everett 2017-03-31 10:56:39 -04:00
parent 28099162ab
commit ebd74f09cf
1 changed files with 8 additions and 1 deletions

View File

@ -161,7 +161,14 @@ public class CancelTests extends ReindexTestCase {
});
// And check the status of the response
BulkByScrollResponse response = future.get();
BulkByScrollResponse response;
try {
response = future.get(30, TimeUnit.SECONDS);
} catch (Exception e) {
String tasks = client().admin().cluster().prepareListTasks().setParentTaskId(mainTask.getTaskId())
.setDetailed(true).get().toString();
throw new RuntimeException("Exception while waiting for the response. Running tasks: " + tasks, e);
}
assertThat(response.getReasonCancelled(), equalTo("by user request"));
assertThat(response.getBulkFailures(), emptyIterable());
assertThat(response.getSearchFailures(), emptyIterable());