server/src/test/java/org/elasticsearch/health/node/DiskHealthIndicatorServiceTests.java
Set<DiscoveryNode> masterNodes = createNodes(masterRole);
        Set<DiscoveryNode> otherNodes = createNodes(otherRoles);
        ClusterService clusterService = createClusterService(Sets.union(Sets.union(dataNodes, masterNodes), otherNodes), true);
        DiskHealthIndicatorService diskHealthIndicatorService = new DiskHealthIndicatorService(clusterService);
        int numberOfRedMasterNodes = randomIntBetween(1, masterNodes.size());
        int numberOfRedOtherNodes = randomIntBetween(1, otherNodes.size());
        int numberOfYellowDataNodes = randomIntBetween(1, dataNodes.size());
        HealthInfo healthInfo = createHealthInfo(
            List.of(
                new HealthInfoConfig(HealthStatus.YELLOW, numberOfYellowDataNodes, dataNodes),
                new HealthInfoConfig(HealthStatus.RED, numberOfRedMasterNodes, masterNodes),
                new HealthInfoConfig(HealthStatus.RED, numberOfRedOtherNodes, otherNodes)
            )
        );
        HealthIndicatorResult result = diskHealthIndicatorService.calculate(true, healthInfo);
        assertThat(result.status(), equalTo(HealthStatus.RED));
        assertThat(
            result.symptom(),
            equalTo(
                "1 index is not allowed to be updated because "
                    + (numberOfYellowDataNodes + (numberOfYellowDataNodes == 1 ? " node is" : " nodes are"))
                    + " out of disk or running low on disk space. Furthermore "
                    + (numberOfRedMasterNodes + numberOfRedOtherNodes)
                    + " nodes with roles: "
                    + Stream.concat(masterRole.stream(), otherRoles.stream()).map(DiscoveryNodeRole::roleName).sorted().toList()
                    + " are out of disk or running low on disk space."
            )
        );
        List<HealthIndicatorImpact> impacts = result.impacts();
        assertThat(impacts.size(), equalTo(3));