You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[tests] Improve reliability of emulator attach (dotnet#313)
Sometimes [the PR builder won't launch the emulator][0]:
Tool .../emulator execution started with arguments: -avd "XamarinAndroidUnitTestRunner" -port "5600"
Task Adb
Arguments: -s emulator-5600 wait-for-device
Task Adb
Arguments: -s emulator-5600 install -r ".../Mono.Android_Tests-Signed.apk"
error: device 'emulator-5600' not found
...
emulator: WARNING: Increasing RAM size to 1GB
...
(Omitting lots of additional output...)
What *appears* to be happening is that emulator creation and launching
is occasionally happening *after* we attempt to install the `.apk`
onto the device, which doesn't really make sense.
Resort to the standby of the lazy: add a **sleep**(1) invocation
before we call `adb wait-for-device`, on the hopes that 10 seconds is
sufficient time to allow the emulator creation and launch to proceed
far enough for `adb wait-for-device` to actually *do something*, in
turn allowing `adb install` to likewise *do something*.
[0]: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android-pr-builder/300/console
0 commit comments