diff --git a/subcommand/health-sync/command_test.go b/subcommand/health-sync/command_test.go index bf0899d4..74c3970e 100644 --- a/subcommand/health-sync/command_test.go +++ b/subcommand/health-sync/command_test.go @@ -390,16 +390,15 @@ func TestRun(t *testing.T) { expCheck.Status = ecsHealthToConsulHealth(hsc.status) // If there are multiple health sync containers and one of them is unhealthy // then the service check should be critical. - if len(c.healthSyncContainers) > 1 { - for containerName := range c.healthSyncContainers { - log.Printf("Container Name: %s, ActualStatus:%s \n", containerName, c.healthSyncContainers[containerName].status) - if c.healthSyncContainers[containerName].status == ecs.HealthStatusUnhealthy { - expCheck.Status = api.HealthCritical - markDataplaneContainerUnhealthy = true - break - } + for containerName := range c.healthSyncContainers { + log.Printf("Container Name: %s, ActualStatus:%s \n", containerName, c.healthSyncContainers[containerName].status) + if c.healthSyncContainers[containerName].status == ecs.HealthStatusUnhealthy { + expCheck.Status = api.HealthCritical + markDataplaneContainerUnhealthy = true + break } } + } found = true break