Skip to content

Commit f5fc895

Browse files
ci(e2e): fix Android E2E retry — the emulator-runner executes the script line-by-line, so the multi-line run_e2e() function broke; collapse the retry to a single line
1 parent 5bfc037 commit f5fc895

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

.github/workflows/react-native-sdk-e2e.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -123,22 +123,7 @@ jobs:
123123
adb shell settings put global animator_duration_scale 0
124124
adb shell settings put global hide_error_dialogs 1
125125
sleep 5
126-
run_e2e() {
127-
./gradlew :app:connectedDebugAndroidTest --no-daemon -Pandroid.testInstrumentationRunnerArguments.LOGIN_EMAIL="$LOGIN_EMAIL" -Pandroid.testInstrumentationRunnerArguments.LOGIN_PASSWORD="$LOGIN_PASSWORD" -Pandroid.testInstrumentationRunnerArguments.LOGIN_WRONG_PASSWORD="$LOGIN_WRONG_PASSWORD" -Pandroid.testInstrumentationRunnerArguments.TENANT_NAME_1="$TENANT_NAME_1" -Pandroid.testInstrumentationRunnerArguments.TENANT_NAME_2="$TENANT_NAME_2" -Pandroid.testInstrumentationRunnerArguments.GOOGLE_EMAIL="$GOOGLE_EMAIL" -Pandroid.testInstrumentationRunnerArguments.GOOGLE_PASSWORD="$GOOGLE_PASSWORD"
128-
}
129-
# The emulator's launcher intermittently ANRs under load, hiding the app and failing
130-
# an otherwise-passing run. Retry the test task (same emulator) so a random hiccup
131-
# doesn't red the gate; pass on the first green attempt.
132-
for attempt in 1 2 3; do
133-
echo "::group::Android E2E attempt $attempt"
134-
if run_e2e; then echo "::endgroup::"; exit 0; fi
135-
echo "::endgroup::"
136-
echo "Android E2E attempt $attempt failed (likely emulator/launcher flake); retrying"
137-
adb shell am force-stop com.frontegg.demo || true
138-
adb shell settings put global hide_error_dialogs 1 || true
139-
sleep 5
140-
done
141-
exit 1
126+
for attempt in 1 2 3; do echo "Android E2E attempt $attempt"; if ./gradlew :app:connectedDebugAndroidTest --no-daemon -Pandroid.testInstrumentationRunnerArguments.LOGIN_EMAIL="$LOGIN_EMAIL" -Pandroid.testInstrumentationRunnerArguments.LOGIN_PASSWORD="$LOGIN_PASSWORD" -Pandroid.testInstrumentationRunnerArguments.LOGIN_WRONG_PASSWORD="$LOGIN_WRONG_PASSWORD" -Pandroid.testInstrumentationRunnerArguments.TENANT_NAME_1="$TENANT_NAME_1" -Pandroid.testInstrumentationRunnerArguments.TENANT_NAME_2="$TENANT_NAME_2" -Pandroid.testInstrumentationRunnerArguments.GOOGLE_EMAIL="$GOOGLE_EMAIL" -Pandroid.testInstrumentationRunnerArguments.GOOGLE_PASSWORD="$GOOGLE_PASSWORD"; then exit 0; fi; echo "Android E2E attempt $attempt failed (likely emulator/launcher flake); retrying"; adb shell am force-stop com.frontegg.demo || true; adb shell settings put global hide_error_dialogs 1 || true; sleep 5; done; exit 1
142127
143128
- name: Collect JUnit reports
144129
if: always()

0 commit comments

Comments
 (0)