Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/scripts/android/android-emulator-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ log "Starting Android emulator"
nohup emulator -no-metrics -partition-size 1024 -memory 4096 -wipe-data -no-window -no-snapshot -noaudio -no-boot-anim -avd "${ANDROID_EMULATOR_NAME}" &

log "Waiting for Android emulator startup"
adb start-server
sleep 5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this delay for the same reason as #223?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was consistently running into timeouts with

timeout "${ANDROID_EMULATOR_TIMEOUT}" adb wait-for-any-device
timeout: the monitored command dumped core
/home/runner/work/github-workflows/github-workflows/.github/workflows/scripts/android/android-emulator-tests.sh: line 99:  3526 Aborted                 timeout "${ANDROID_EMULATOR_TIMEOUT}" adb wait-for-any-device
WARNING      | Failed to process .ini file /home/runner/.android/emu-update-last-check.ini for reading.
Error: Process completed with exit code 134.

And no android CI was passing so this was my workaround to unblock CI. Happy to revisit though

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And adb start-server fixed this for you? Did you look over the log before the failure occurred?

I'm wondering if maybe the emulator failed to start for some other reason (like being too low in disk space: https://github.com/marketplace/actions/swift-android-action#error-timeout-waiting-for-emulator-to-boot) and the timeout was just the only indication of the issue…

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be overlooking it, but the only thing I see different between the failing log and the passing log is

ERROR        | Unable to connect to adb daemon on port: 5037

and then ultimately

timeout: the monitored command dumped core
/home/runner/work/github-workflows/github-workflows/.github/workflows/scripts/android/android-emulator-tests.sh: line 99:  3526 Aborted                 timeout "${ANDROID_EMULATOR_TIMEOUT}" adb wait-for-any-device

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not actually timing out, it is that the timeout command is reporting a core dump. It certainly didn't wait the full 300 second ANDROID_EMULATOR_TIMEOUT duration.

I wonder if maybe timeout and adb just don't play nicely together for some weird reason. I'll experiment with an alternative fix in #223 unless you want to tinker with it?

timeout "${ANDROID_EMULATOR_TIMEOUT}" adb wait-for-any-device

log "Prepare Swift test package"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/swift_package_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ jobs:
run: ${{ inputs.linux_pre_build_command }}
- name: Install Swift SDK for Android and build
env:
BUILD_FLAGS: ${{ inputs.enable_android_sdk_checks && '--build-tests' }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }}
BUILD_FLAGS: ${{ inputs.enable_android_sdk_checks && '--build-tests' || '' }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }}
shell: bash
run: |
${{ inputs.android_sdk_pre_build_command }}
Expand Down