Skip to content

Commit

Permalink
fix(fss): fix fss Windows flaky integration test (#1591)
Browse files Browse the repository at this point in the history
(cherry picked from commit 98bea26)
  • Loading branch information
yitingb authored and junfuchen99 committed Mar 25, 2024
1 parent 56d191f commit 1f85f95
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1f85f95

Please sign in to comment.