From 6322382eadb1ddc0be7c2ee7b3413b8a6b5ef4af Mon Sep 17 00:00:00 2001 From: Steve Soltys Date: Tue, 10 Oct 2023 23:59:30 -0400 Subject: [PATCH] Retry up to three times when tests fail --- .github/workflows/test.yml | 31 ++++++++++--------- .../seedvault/e2e/screen/UiDeviceScreen.kt | 2 +- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 700f45eb8..57b0f0f42 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -65,21 +65,24 @@ jobs: run: ./gradlew :app:assembleAndroidTest - name: Run tests - uses: reactivecircus/android-emulator-runner@v2 + uses: Wandalen/wretry.action@1.3.0 with: - api-level: ${{ matrix.android_target }} - target: ${{ matrix.emulator_type }} - arch: x86_64 - force-avd-creation: false - emulator-options: -writable-system -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - profile: pixel_6a - heap-size: '512M' - ram-size: '4096M' - disk-size: '14G' - sdcard-path-or-size: '4096M' - cores: 3 - disable-animations: false - script: ./.github/scripts/run_tests.sh + attempt_limit: 3 + action: reactivecircus/android-emulator-runner@v2 + with: | + api-level: ${{ matrix.android_target }} + target: ${{ matrix.emulator_type }} + arch: x86_64 + force-avd-creation: false + emulator-options: -writable-system -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + profile: pixel_6a + heap-size: '512M' + ram-size: '4096M' + disk-size: '14G' + sdcard-path-or-size: '4096M' + cores: 2 + disable-animations: true + script: ./.github/scripts/run_tests.sh - name: Upload test results if: always() diff --git a/app/src/androidTest/java/com/stevesoltys/seedvault/e2e/screen/UiDeviceScreen.kt b/app/src/androidTest/java/com/stevesoltys/seedvault/e2e/screen/UiDeviceScreen.kt index fdcdd67b9..b3c73c2d8 100644 --- a/app/src/androidTest/java/com/stevesoltys/seedvault/e2e/screen/UiDeviceScreen.kt +++ b/app/src/androidTest/java/com/stevesoltys/seedvault/e2e/screen/UiDeviceScreen.kt @@ -32,6 +32,6 @@ abstract class UiDeviceScreen { private fun device() = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) .also { - Configurator.getInstance().waitForSelectorTimeout = 60000 + Configurator.getInstance().waitForSelectorTimeout = 180000 } }