Skip to content

Commit

Permalink
[tests] Ensure emulator is killed (dotnet#602)
Browse files Browse the repository at this point in the history
A "funny thing" happened in [PR Build dotnet#958][0]: `adb` failed:

	Target ReleaseAndroidTarget:
	Task "Adb"
		...
		Tool /Users/builder/android-toolchain/sdk/platform-tools/adb execution started with arguments: -s emulator-5570 logcat -d
		...
	Task "Adb" execution -- FAILED

I have no idea why `adb` is failing, but *because* it failed, the
emulator was never shutdown and killed.

Add `ContinueOnError="True"` to most of the tasks within the
`ReleaseAndroidTarget` target to ensure that the emulator is shutdown
and killed.

[0]: https://jenkins.mono-project.com/job/xamarin-android-pr-builder/958/
  • Loading branch information
jonpryor committed May 24, 2017
1 parent 4799ea2 commit 3fa9e9e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build-tools/scripts/UnitTestApks.targets
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,26 @@
<Target Name="ReleaseAndroidTarget">
<Adb
Condition="'@(_FailedComponent)' != ''"
ContinueOnError="True"
Arguments="$(_EmuTarget) logcat -d"
ToolExe="$(AdbToolExe)"
ToolPath="$(AdbToolPath)"
/>
<Adb
Condition=" '$(_EmuTarget)' != '' "
ContinueOnError="True"
Arguments="$(_EmuTarget) emu kill"
ToolExe="$(AdbToolExe)"
ToolPath="$(AdbToolPath)"
/>
<KillProcess
Condition=" '$(_EmuTarget)' != '' "
ContinueOnError="True"
ProcessId="$(_EmuPid)"
/>
<Adb
Arguments="kill-server"
ContinueOnError="True"
ToolExe="$(AdbToolExe)"
ToolPath="$(AdbToolPath)"
/>
Expand Down

0 comments on commit 3fa9e9e

Please sign in to comment.