server/src/test/java/org/elasticsearch/health/node/DiskHealthIndicatorServiceTests.java
assertThat(details.get("blocked_indices"), equalTo(0));
    }
    /*
     * Simulates a cluster with healthy all-role nodes and a blocked index. This situation can occur when the cluster is recovering from
     * being out of disk space. Either the nodes that were out of space are currently above the high threshold but actively relocating
     * their shards to other nodes or all the nodes are healthy but the DiskThresholdMonitor hasn't updated yet the index status.
     * We expect 1 impact and 1 diagnosis.
     */
    public void testRedWithBlockedIndicesAndGreenNodes() throws IOException {
        Set<DiscoveryNode> discoveryNodes = createNodesWithAllRoles();
        ClusterService clusterService = createClusterService(discoveryNodes, true);
        DiskHealthIndicatorService diskHealthIndicatorService = new DiskHealthIndicatorService(clusterService);
        HealthStatus expectedStatus = HealthStatus.RED;
        HealthInfo healthInfo = createHealthInfoWithOneUnhealthyNode(HealthStatus.GREEN, discoveryNodes);
        HealthIndicatorResult result = diskHealthIndicatorService.calculate(true, healthInfo);
        assertThat(result.status(), equalTo(expectedStatus));
        assertThat(
            result.symptom(),
            equalTo(
                "1 index is not allowed to be updated because the cluster was running out of "
                    + "disk space. The cluster is recovering and ingest capabilities should be restored within a few minutes."
            )
        );
        assertThat(result.impacts().size(), equalTo(1));
        HealthIndicatorImpact impact = result.impacts().get(0);
        assertNotNull(impact);
        List<ImpactArea> impactAreas = impact.impactAreas();
        assertThat(impactAreas.size(), equalTo(1));
        assertThat(impactAreas.get(0), equalTo(ImpactArea.INGEST));
        assertThat(impact.severity(), equalTo(1));