Explorar el Código

ProactiveStorageIT fix and debug info (#67094)

Fix simple bug and add a bit more debug info to help diagnosing if this
fails again.

Closes #66864
Henning Andersen hace 4 años
padre
commit
e85e40cf84

+ 2 - 1
x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ProactiveStorageIT.java

@@ -69,7 +69,7 @@ public class ProactiveStorageIT extends AutoscalingStorageIntegTestCase {
                     )
                     .toArray(IndexRequestBuilder[]::new)
             );
-            client().admin().indices().rolloverIndex(new RolloverRequest(dsName, null));
+            assertAcked(client().admin().indices().rolloverIndex(new RolloverRequest(dsName, null)).actionGet());
         }
         forceMerge();
         refresh();
@@ -90,6 +90,7 @@ public class ProactiveStorageIT extends AutoscalingStorageIntegTestCase {
         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)
         );

+ 6 - 0
x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingDeciderResults.java

@@ -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;
@@ -139,4 +140,9 @@ public class AutoscalingDeciderResults implements ToXContent, Writeable {
     public int hashCode() {
         return Objects.hash(currentCapacity, results);
     }
+
+    @Override
+    public String toString() {
+        return Strings.toString(this);
+    }
 }