From 1f85f95a1769ba80de1e65d953c0b13943f0a8f2 Mon Sep 17 00:00:00 2001 From: yitingb <118219519+yitingb@users.noreply.github.com> Date: Mon, 25 Mar 2024 10:29:02 -0700 Subject: [PATCH] fix(fss): fix fss Windows flaky integration test (#1591) (cherry picked from commit 98bea264102e50bbf2d91d7ba20c7d5992cf12cd) --- ...entStatusChangeFleetStatusServiceTest.java | 3 --- .../status/fss_service_10s_recovery.yaml | 20 ++++++++++++------- .../status/fss_service_5s_recovery.yaml | 12 +++++++---- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/integrationtests/java/com/aws/greengrass/integrationtests/status/ComponentStatusChangeFleetStatusServiceTest.java b/src/integrationtests/java/com/aws/greengrass/integrationtests/status/ComponentStatusChangeFleetStatusServiceTest.java index e06e89f8b0..e5af399a78 100755 --- a/src/integrationtests/java/com/aws/greengrass/integrationtests/status/ComponentStatusChangeFleetStatusServiceTest.java +++ b/src/integrationtests/java/com/aws/greengrass/integrationtests/status/ComponentStatusChangeFleetStatusServiceTest.java @@ -23,8 +23,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledOnOs; -import org.junit.jupiter.api.condition.OS; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; @@ -161,7 +159,6 @@ void GIVEN_two_components_errored_and_recovered_THEN_fss_should_send_only_one_re componentStatusAssertion(fleetStatusDetails, SERVICE_B, State.RUNNING); } @Test - @DisabledOnOs(OS.WINDOWS) void GIVEN_three_components_errored_and_recovered_THEN_fss_should_send_only_one_recovery_message_and_one_errored_message_should_contain_recovery_message() throws Exception { statusChange = new CountDownLatch(4); deviceConfiguration = new DeviceConfiguration(kernel, "ThingName", "xxxxxx-ats.iot.us-east-1.amazonaws.com", diff --git a/src/integrationtests/resources/com/aws/greengrass/integrationtests/status/fss_service_10s_recovery.yaml b/src/integrationtests/resources/com/aws/greengrass/integrationtests/status/fss_service_10s_recovery.yaml index a887fe61c3..4e3cfb4203 100644 --- a/src/integrationtests/resources/com/aws/greengrass/integrationtests/status/fss_service_10s_recovery.yaml +++ b/src/integrationtests/resources/com/aws/greengrass/integrationtests/status/fss_service_10s_recovery.yaml @@ -32,8 +32,10 @@ services: script: echo NUL > ErrorIndicator startup: requiresPrivilege: true - script: |- - powershell -command "& { if (Test-Path ErrorIndicator) { ping -n 7 127.0.0.1 > NUL; echo "Startup Failed"; exit 1; } }" + script: + if exist "ErrorIndicator" ( + ping 127.0.0.1 -n 7 > NUL && echo Startup Failed && exit /b 1 + ) recover: requiresPrivilege: true script: echo Fixing ServiceA && del ErrorIndicator @@ -65,11 +67,13 @@ services: script: echo NUL > ErrorIndicator startup: requiresPrivilege: true - script: |- - powershell -command "& {if (Test-Path ErrorIndicator) { ping -n 3 127.0.0.1 > NUL; echo "Startup Failed"; exit 1; } }" + script: + if exist "ErrorIndicator" ( + ping 127.0.0.1 -n 3 > NUL && echo Startup Failed && exit /b 1 + ) recover: requiresPrivilege: true - script: del ErrorIndicator && ping -n 2 127.0.0.1 > NUL + script: del ErrorIndicator && echo Fixing ServiceB ServiceC: lifecycle: posix: @@ -96,8 +100,10 @@ services: script: echo NUL > ErrorIndicator startup: requiresPrivilege: true - script: |- - powershell -command "& { if (Test-Path ErrorIndicator) { echo "Startup Failed"; exit 1; } }" + script: + if exist "ErrorIndicator" ( + echo Startup Failed && exit /b 1 + ) recover: requiresPrivilege: true script: ping -n 10 127.0.0.1 > NUL && del ErrorIndicator diff --git a/src/integrationtests/resources/com/aws/greengrass/integrationtests/status/fss_service_5s_recovery.yaml b/src/integrationtests/resources/com/aws/greengrass/integrationtests/status/fss_service_5s_recovery.yaml index ce49215c59..bffc583fe0 100644 --- a/src/integrationtests/resources/com/aws/greengrass/integrationtests/status/fss_service_5s_recovery.yaml +++ b/src/integrationtests/resources/com/aws/greengrass/integrationtests/status/fss_service_5s_recovery.yaml @@ -32,8 +32,10 @@ services: script: echo NUL > ErrorIndicator startup: requiresPrivilege: true - script: |- - powershell -command "& {if (Test-Path ErrorIndicator) { ping -n 3 127.0.0.1 > NUL; echo "Startup Failed"; exit 1; } }" + script: + if exist "ErrorIndicator" ( + ping 127.0.0.1 -n 3 > NUL && echo Startup Failed && exit /b 1 + ) recover: requiresPrivilege: true script: echo Fixing ServiceA && del ErrorIndicator @@ -64,8 +66,10 @@ services: script: echo NUL > ErrorIndicator startup: requiresPrivilege: true - script: |- - powershell -command "& { if (Test-Path ErrorIndicator) { echo "Startup Failed"; exit 1; } }" + script: + if exist "ErrorIndicator" ( + echo Startup Failed && exit /b 1 + ) recover: requiresPrivilege: true script: ping -n 5 127.0.0.1 > NUL && del ErrorIndicator