### CI Link

https://gradle-enterprise.elastic.co/s/dvtf7swsnm44o

### Repro line

./gradlew ':x-pack:plugin:autoscaling:test' --tests "org.elasticsearch.xpack.autoscaling.capacity.AutoscalingCalculateCapacityServiceTests.testContext" -Dtests.seed=15E8E10F966ECA7A -Dtests.locale=be-BY -Dtests.timezone=America/Noronha -Druntime.java=17	

### Does it reproduce?

Yes

### Applicable branches

main

### Failure history

https://gradle-enterprise.elastic.co/scans/tests?search.timeZoneId=Europe/Rome&tests.container=org.elasticsearch.xpack.autoscaling.capacity.AutoscalingCalculateCapacityServiceTests&tests.test=testContext

### Failure excerpt

```
org.elasticsearch.xpack.autoscaling.capacity.AutoscalingCalculateCapacityServiceTests > testContext FAILED
    java.lang.NullPointerException: Cannot invoke "org.elasticsearch.xpack.autoscaling.capacity.AutoscalingCapacity.node()" because the return value of "org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderContext.currentCapacity()" is null
        at __randomizedtesting.SeedInfo.seed([EB0EF2643F2D6C41:7D3B02C92A094B8F]:0)
        at org.elasticsearch.xpack.autoscaling.capacity.AutoscalingCalculateCapacityServiceTests.testContext(AutoscalingCalculateCapacityServiceTests.java:225)
```
x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingCalculateCapacityServiceTests.java
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.unit.Processors;
import org.elasticsearch.core.Tuple;
import org.elasticsearch.snapshots.SnapshotShardSizeInfo;
import org.elasticsearch.xpack.autoscaling.AutoscalingMetadata;
import org.elasticsearch.xpack.autoscaling.AutoscalingTestCase;
import org.elasticsearch.xpack.autoscaling.capacity.nodeinfo.AutoscalingNodeInfo;
import org.elasticsearch.xpack.autoscaling.capacity.nodeinfo.AutoscalingNodesInfo;
import org.elasticsearch.xpack.autoscaling.policy.AutoscalingPolicy;
import org.elasticsearch.xpack.autoscaling.policy.AutoscalingPolicyMetadata;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.SortedMap;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.Matchers.sameInstance;
public class AutoscalingCalculateCapacityServiceTests extends AutoscalingTestCase {