|
@@ -805,7 +805,20 @@ public abstract class ESRestTestCase extends ESTestCase {
|
|
|
request.addParameter("wait_for_no_relocating_shards", "true");
|
|
|
request.addParameter("timeout", "70s");
|
|
|
request.addParameter("level", "shards");
|
|
|
- client().performRequest(request);
|
|
|
+ try {
|
|
|
+ client().performRequest(request);
|
|
|
+ } catch (ResponseException e) {
|
|
|
+ if (e.getResponse().getStatusLine().getStatusCode() == HttpStatus.SC_REQUEST_TIMEOUT) {
|
|
|
+ try {
|
|
|
+ final Response clusterStateResponse = client().performRequest(new Request("GET", "/_cluster/state"));
|
|
|
+ fail("timed out waiting for green state for index [" + index + "] " +
|
|
|
+ "cluster state [" + EntityUtils.toString(clusterStateResponse.getEntity()) + "]");
|
|
|
+ } catch (Exception inner) {
|
|
|
+ e.addSuppressed(inner);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|