server/src/test/java/org/elasticsearch/health/node/DiskHealthIndicatorServiceTests.java
indexNameToNodeIdsMap.put(indexName, new HashSet<>(randomNonEmptySubsetOf(nodeIds)));
        }
        Set<DiscoveryNode> allNodes = Sets.union(Sets.union(dataNodes, masterNodes), otherNodes);
        try (ClusterService clusterService = createClusterService(Set.of(), allNodes, indexNameToNodeIdsMap)) {
            HealthStatus expectedStatus = HealthStatus.YELLOW;
            HealthInfo healthInfo = createHealthInfo(new HealthInfoConfig(expectedStatus, allNodes.size(), allNodes));
            DiskHealthIndicatorService diskHealthIndicatorService = new DiskHealthIndicatorService(clusterService);
            HealthIndicatorResult result = diskHealthIndicatorService.calculate(true, healthInfo);
            assertThat(result.status(), equalTo(expectedStatus));
            assertThat(result.symptom(), containsString("with roles: [data"));
            assertThat(result.symptom(), containsString("out of disk or running low on disk space."));
            assertThat(result.impacts().size(), equalTo(3));
            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));
            assertThat(
                impact.impactDescription(),
                startsWith("The cluster is at risk of not being able to insert or update documents in the affected indices [")
            );
            assertThat(result.diagnosisList().size(), equalTo(3));
            {
                Diagnosis diagnosis = result.diagnosisList().get(0);
                List<Diagnosis.Resource> affectedResources = diagnosis.affectedResources();
                assertThat(affectedResources.size(), equalTo(2));
                assertThat(affectedResources.get(0).getType(), is(Diagnosis.Resource.Type.NODE));
                assertThat(affectedResources.get(0).getNodes().size(), is(dataNodes.size()));
                List<DiscoveryNode> affectedNodes = dataNodes.stream()