Skip to content

Commit

Permalink
Fix FullClusterRestartIT.testHistoryUUIDIsAdded
Browse files Browse the repository at this point in the history
  • Loading branch information
tlrx committed Jan 31, 2019
1 parent 7a597ca commit 04de9ee
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.startsWith;

Expand Down Expand Up @@ -970,10 +971,14 @@ public void testHistoryUUIDIsAdded() throws Exception {
createIndex.setJsonEntity(Strings.toString(mappingsAndSettings));
client().performRequest(createIndex);
} else {
ensureGreenLongWait(index);

Request statsRequest = new Request("GET", index + "/_stats");
statsRequest.addParameter("level", "shards");
Response response = client().performRequest(statsRequest);
List<Object> shardStats = ObjectPath.createFromResponse(response).evaluate("indices." + index + ".shards.0");
assertThat(shardStats, notNullValue());
assertThat("Expected stats for 2 shards", shardStats, hasSize(2));
String globalHistoryUUID = null;
for (Object shard : shardStats) {
final String nodeId = ObjectPath.evaluate(shard, "routing.node");
Expand Down

0 comments on commit 04de9ee

Please sign in to comment.