test: verify `size_to_upgrade_in_bytes` in assertBusy(...)

Relates to #25311
This commit is contained in:
Martijn van Groningen 2017-06-21 13:45:35 +02:00
parent 645bb9d0fb
commit 926527adc3
No known key found for this signature in database
GPG Key ID: AB236F4FCF2AF12A
1 changed files with 8 additions and 6 deletions

View File

@ -427,12 +427,14 @@ public class FullClusterRestartIT extends ESRestTestCase {
assertEquals(200, r.getStatusLine().getStatusCode());
// Post upgrade checks:
rsp = toMap(client().performRequest("GET", "/" + index + "/_upgrade"));
indexUpgradeStatus = (Map<?, ?>) XContentMapValues.extractValue("indices." + index, rsp);
totalBytes = (Integer) indexUpgradeStatus.get("size_in_bytes");
assertThat(totalBytes, greaterThan(0));
toUpgradeBytes = (Integer) indexUpgradeStatus.get("size_to_upgrade_in_bytes");
assertEquals(0, toUpgradeBytes);
assertBusy(() -> {
Map<String, Object> rsp2 = toMap(client().performRequest("GET", "/" + index + "/_upgrade"));
Map<?, ?> indexUpgradeStatus2 = (Map<?, ?>) XContentMapValues.extractValue("indices." + index, rsp2);
int totalBytes2 = (Integer) indexUpgradeStatus2.get("size_in_bytes");
assertThat(totalBytes2, greaterThan(0));
int toUpgradeBytes2 = (Integer) indexUpgradeStatus2.get("size_to_upgrade_in_bytes");
assertEquals(0, toUpgradeBytes2);
});
rsp = toMap(client().performRequest("GET", "/" + index + "/_segments"));
Map<?, ?> shards = (Map<?, ?>) XContentMapValues.extractValue("indices." + index + ".shards", rsp);