Skip to content

Conversation

@grendello
Copy link
Contributor

We currently fail to kill the emulator if any of the steps executing APK tests
fail. This is because the failed task stops execution of all the other targets
defined in that file. In effect we leave running instances of the emulator on
the build bots, should such a failure happen.

This diff adds ContinueOnError="ErrorAndContinue" to each task in the target file so that we are sure to hit the ReleaseAndroidTarget` target no matter what.

We currently fail to kill the emulator if any of the steps executing APK tests
fail. This is because the failed task stops execution of all the other targets
defined in that file. In effect we leave running instances of the emulator on
the build bots, should such a failure happen.

This diff adds `ContinueOnError="ErrorAndContinue" to each task in the target
file so that we are sure to hit the `ReleaseAndroidTarget` target no matter what.
@grendello grendello requested a review from jonpryor as a code owner September 10, 2018 19:29
@jonpryor
Copy link
Contributor

It...failed?!

Of course, the reason is inexplicable, so I've restarted the build. :-/

error MSB4018: The "CreateAndroidEmulator" task failed unexpectedly. [/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets]
error MSB4018: System.IO.IOException: Write fault on path /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/[Unknown] [/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets]
error MSB4018:   at System.IO.FileStream.WriteInternal (System.Byte[] src, System.Int32 offset, System.Int32 count) [0x000be] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-04/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/FileStream.cs:658  [/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets]
error MSB4018:   at System.IO.FileStream.Write (System.Byte[] array, System.Int32 offset, System.Int32 count) [0x00090] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-04/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/FileStream.cs:614  [/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets]
error MSB4018:   at System.IO.StreamWriter.Flush (System.Boolean flushStream, System.Boolean flushEncoder) [0x0007e] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-04/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/io/streamwriter.cs:318  [/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets]
error MSB4018:   at System.IO.StreamWriter.Write (System.Char[] buffer) [0x00079] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-04/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/io/streamwriter.cs:392  [/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets]
error MSB4018:   at System.IO.TextWriter.WriteLine () [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-04/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/io/textwriter.cs:372  [/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets]
error MSB4018:   at Xamarin.Android.Tools.BootstrapTasks.CreateAndroidEmulator.Exec (System.String android, System.String arguments, System.Diagnostics.DataReceivedEventHandler stderr) [0x00161] in /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/CreateAndroidEmulator.cs:136  [/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets]
error MSB4018:   at Xamarin.Android.Tools.BootstrapTasks.CreateAndroidEmulator.Run (System.String android) [0x0002d] in /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/CreateAndroidEmulator.cs:74  [/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets]
error MSB4018:   at Xamarin.Android.Tools.BootstrapTasks.CreateAndroidEmulator.Execute () [0x001a0] in /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/CreateAndroidEmulator.cs:46  [/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets]
error MSB4018:   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in /_/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:631  [/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets]
error MSB4018:   at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__26.MoveNext () [0x001f6] in /_/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:787  [/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets]

Write fault on path …/xamarin-android/tests/[Unknown]?!

Which we've seen before (sigh), and was caused by writing to a pipe.

At what point do we start looking for mono bugs?

@grendello
Copy link
Contributor Author

@jonpryor it might be best if we add some jenkins voodoo to restart the build if it spots one of the known-bad behaviors (native mono crash for instance, or the above) and yes, we probably should start looking for Mono bugs in some cases... The above [Unknown], however, is the default name for FileStream and will be changed if writing to a named file. It remains at its default value because in this case we're writing to stdin of a process which might have already died - this is our bug. The process handling code in CreateAndroidEmulator is racy (System.Diagnostics.Process has many quirks...), I'll open a PR later today with a proposed fix for this.

@grendello grendello merged commit 9d77ff1 into dotnet:master Sep 11, 2018
@grendello grendello deleted the tests-kill-emulator branch September 11, 2018 07:00
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants