### 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
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/91085")
    public void testContext() {
        ClusterState state = ClusterState.builder(ClusterName.DEFAULT).build();
        ClusterInfo info = ClusterInfo.EMPTY;
        SortedSet<String> roleNames = randomRoles();
        boolean hasDataRole = roleNames.stream().anyMatch(r -> r.equals("data") || r.startsWith("data_"));
        AutoscalingCalculateCapacityService service = new AutoscalingCalculateCapacityService(Set.of(new FixedAutoscalingDeciderService()));
        SnapshotShardSizeInfo snapshotShardSizeInfo = new SnapshotShardSizeInfo(Map.of());
        AutoscalingDeciderContext context = service.createContext(
            roleNames,
            state,
            info,
            snapshotShardSizeInfo,
            n -> Optional.of(new AutoscalingNodeInfo(randomNonNegativeLong(), randomProcessors())),
            () -> {}
        );
        assertSame(state, context.state());
        assertThat(context.nodes(), equalTo(Set.of()));
        assertThat(context.currentCapacity(), equalTo(AutoscalingCapacity.ZERO));
        assertThat(context.info(), sameInstance(info));
        assertThat(context.snapshotShardSizeInfo(), sameInstance(snapshotShardSizeInfo));
        Set<DiscoveryNodeRole> roles = roleNames.stream().map(DiscoveryNodeRole::getRoleFromRoleName).collect(Collectors.toSet());
        Set<DiscoveryNodeRole> otherRoles = mutateRoles(roleNames).stream()
            .map(DiscoveryNodeRole::getRoleFromRoleName)
            .collect(Collectors.toSet());
        final long memory = between(0, 1000);
        state = ClusterState.builder(ClusterName.DEFAULT)
            .nodes(
                DiscoveryNodes.builder().add(new DiscoveryNode("nodeId", buildNewFakeTransportAddress(), Map.of(), roles, Version.CURRENT))
            )