Skip to content

Commit

Permalink
ProactiveStorageIT fix and debug info (#67094)
Browse files Browse the repository at this point in the history
Fix simple bug and add a bit more debug info to help diagnosing if this
fails again.

Closes #66864
  • Loading branch information
henningandersen committed Jan 12, 2021
1 parent 60ae51f commit a3a0a9d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void testScaleUp() throws IOException, InterruptedException {
)
.toArray(IndexRequestBuilder[]::new)
);
client().admin().indices().rolloverIndex(new RolloverRequest(dsName, null));
assertAcked(client().admin().indices().rolloverIndex(new RolloverRequest(dsName, null)).actionGet());
}
forceMerge();
refresh();
Expand All @@ -104,6 +104,7 @@ public void testScaleUp() throws IOException, InterruptedException {
assertThat(response.results().get(policyName).currentCapacity().total().storage().getBytes(), Matchers.equalTo(enoughSpace));
// ideally, we would count replicas too, but we leave this for follow-up work
assertThat(
response.getResults().get(policyName).toString(),
response.results().get(policyName).requiredCapacity().total().storage().getBytes(),
Matchers.greaterThanOrEqualTo(enoughSpace + used)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.elasticsearch.xpack.autoscaling.capacity;

import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
Expand Down Expand Up @@ -139,4 +140,9 @@ public boolean equals(Object o) {
public int hashCode() {
return Objects.hash(currentCapacity, results);
}

@Override
public String toString() {
return Strings.toString(this);
}
}

0 comments on commit a3a0a9d

Please sign in to comment.