Переглянути джерело

[test] Log AutoscalingDeciderResults after we manually updated total space on nodes (#108861)

`ReactiveStorageIT#testScaleWhileShrinking` failures do not reproduce locally,
the test failed twice over the last three months. I don't see any warnings in the logs
for both failures.

Add additional logging fir the autoscaling decider results response after manually
set total space on nodes, so we have more debug information in the future if the
test fails.
Artem Prigoda 1 рік тому
батько
коміт
24e0d16bbf

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

@@ -29,6 +29,7 @@ import org.elasticsearch.test.junit.annotations.TestLogging;
 import org.elasticsearch.transport.TransportService;
 import org.elasticsearch.xpack.autoscaling.action.GetAutoscalingCapacityAction;
 import org.elasticsearch.xpack.autoscaling.action.PutAutoscalingPolicyAction;
+import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderResults;
 import org.hamcrest.Matchers;
 
 import java.util.Arrays;
@@ -295,8 +296,10 @@ public class ReactiveStorageIT extends AutoscalingStorageIntegTestCase {
 
         GetAutoscalingCapacityAction.Response response = capacity();
         assertThat(response.results().keySet(), equalTo(Set.of(policyName)));
-        assertThat(response.results().get(policyName).currentCapacity().total().storage().getBytes(), equalTo(enoughSpace));
-        assertThat(response.results().get(policyName).requiredCapacity().total().storage().getBytes(), equalTo(enoughSpace));
+        AutoscalingDeciderResults autoscalingDeciderResults = response.results().get(policyName);
+        logger.info("Verifying autoscaling decider results: {} for with node shard stats: {}", autoscalingDeciderResults, byNode);
+        assertThat(autoscalingDeciderResults.currentCapacity().total().storage().getBytes(), equalTo(enoughSpace));
+        assertThat(autoscalingDeciderResults.requiredCapacity().total().storage().getBytes(), equalTo(enoughSpace));
         assertThat(
             response.results().get(policyName).requiredCapacity().node().storage().getBytes(),
             equalTo(maxShardSize + LOW_WATERMARK_BYTES + ReactiveStorageDeciderService.NODE_DISK_OVERHEAD)