Skip to content
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,19 @@ reboot=false

# Too see where these values come from, check out https://github.com/dotnet/xharness/blob/master/src/Microsoft.DotNet.XHarness.Common/CLI/ExitCode.cs
# Avoid any helix-ism in the Xharness!
ADB_DEVICE_ENUMERATION_FAILURE=85
PACKAGE_INSTALLATION_FAILURE=78

case "$exit_code" in
85)
$ADB_DEVICE_ENUMERATION_FAILURE)
# This handles issues where devices or emulators fail to start.
# The only solution is to reboot the machine, so we request a work item retry + agent reboot when this happens
echo 'Encountered ADB_DEVICE_ENUMERATION_FAILURE. This is typically not a failure of the work item. We will run it again and reboot this computer to help its devices'
echo 'If this occurs repeatedly, please check for architectural mismatch, e.g. sending arm64_v8a APKs to an x86_64 / x86 only queue.'
retry=true
reboot=true
;;
78)
$PACKAGE_INSTALLATION_FAILURE)
# This handles issues where APKs fail to install.
# We already reboot a device inside XHarness and now request a work item retry when this happens
echo 'Encountered PACKAGE_INSTALLATION_FAILURE. This is typically not a failure of the work item. We will try it again on another Helix agent'
Expand All @@ -100,16 +102,12 @@ case "$exit_code" in
;;
esac



ADB_DEVICE_ENUMERATION_FAILURE=85
if [ "$retry"]; then
if [ "$retry" == true ]; then
Comment thread
premun marked this conversation as resolved.
"$HELIX_PYTHONPATH" -c "from helix.workitemutil import request_infra_retry; request_infra_retry('Retrying because we could not enumerate all Android devices')"
fi

PACKAGE_INSTALLATION_FAILURE=78
if [ $exit_code -eq PACKAGE_INSTALLATION_FAILURE ]; then
"$HELIX_PYTHONPATH" -c "from helix.workitemutil import request_reboot; request_reboot('Rebooting to allow Android emulator or device to restart.')"
if [ "$reboot" == true ]; then
"$HELIX_PYTHONPATH" -c "from helix.workitemutil import request_reboot; request_reboot('Rebooting to allow Android emulator to restart')"
fi

exit $exit_code