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:
@@ -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());
