Repository navigation
Commit 23afb3a
authored
[tests] Use
Sometimes unit tests will fail, because the emulator failed to start:
Task "StartAndroidEmulator"
…
Tool /Users/runner/Library/Android/sdk/emulator/emulator execution started with arguments: -verbose -no-boot-anim -no-audio -no-snapshot -cache-size 512 -timezone "Etc/UTC" -avd XamarinAndroidTestRunner29-x86_64 -port 5570
…
[emulator stderr] handleCpuAcceleration: feature check for hvf
…
Task "Xamarin.Android.Tools.BootstrapTasks.Adb"
…
Executing: /Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5570 wait-for-device
…
/Users/runner/work/1/s/build-tools/scripts/TestApks.targets(78,5): error : Command /Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5570 wait-for-device failed with exit code -1 [/Users/runner/work/1/s/tests/Mono.Android-Tests/Mono.Android-Tests.csproj]
Done executing task "Xamarin.Android.Tools.BootstrapTasks.Adb" -- FAILED.
Done building target "AcquireAndroidTarget" in project "Mono.Android-Tests.csproj" -- FAILED.
What's happening is that `adb wait-for-device` is timing out after
2 minutes, at which point we give up.
We don't know *why* `adb wait-for-device` is timing out. We have no
additional information to investigate.
Update the `<StartAndroidEmulator/>` task to have a
`StartAndroidEmulator.LogcatFile` property, which is used with the
`emulator -logcat-output` option. This allows us to capture *all*
output that `adb logcat` would provide, including during emulator
startup. This should allow us to further diagnose *why* the emulator
is "hanging" during `adb wait-for-exit`.
Store the full `adb logcat` output into the file
`bin/Test$(Configuration)/logcat-$(Configuration)-full.log`.
This file will be included in the test `xa-build-status*` zip
archives which are saved at the end of a test run.
Additionally, fix a bug in the `DeviceTest.RestartDevice()` method
where it could fail when using `dotnet`:
RunProcess: /Users/runner/Library/Android/dotnet/dotnet /Users/runner/work/1/s/bin/TestRelease/Emulator.csproj /restore /t:AcquireAndroidTarget
(1, , Could not execute because the specified command or file was not found.
We need to be using `dotnet build /path/to/proj.csproj`.emulator -logcat-output to capture device state (dotnet#6432)1 parent 5c06014 commit 23afb3a
4 files changed
Lines changed: 7 additions & 3 deletions
File tree
- build-tools
- Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks
- scripts
- src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
71 | | - | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| 72 | + | |
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
0 commit comments