Skip to content

Commit

Permalink
[tests] Update xUnit packages to the latest 2.4.0 versions (dotnet#1974)
Browse files Browse the repository at this point in the history
(From the "cross your fingers and hope this works" department...)

Context: https://jenkins.mono-project.com/job/xamarin-android-pr-builder/3574/

A Jenkins build is UNSTABLE when any unit tests fail.  In the case of
[PR Build dotnet#3574][0], there were no reported test failures, so what
went wrong?

Further investigation showed that an on-device unit test was crashing:

        /Users/builder/android-toolchain/sdk/platform-tools/adb -s emulator-5570  shell am instrument  -w "Xamarin.Android.Bcl_Tests/xamarin.android.bcltests.NUnitInstrumentation"
        INSTRUMENTATION_RESULT: shortMsg=Process crashed.

The unit test was in turn crashing because of an unhandled exception:

        E/mono    ( 4120): Unhandled Exception: (TaskId:115)
        E/mono    ( 4120): System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer. ---> System.Net.Sockets.SocketException: Connection reset by peer (TaskId:115)
        E/mono    ( 4120):   at System.Net.Sockets.Socket.Receive (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socketFlags) [0x00017] in /Users/builder/jenkins/workspace/xamarin-android/xamarin-android/external/mono/mcs/class/referencesource/System/net/System/Net/Sockets/Socket.cs:1773  (TaskId:115)
        E/mono    ( 4120):   at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x0009b] in /Users/builder/jenkins/workspace/xamarin-android/xamarin-android/external/mono/mcs/class/referencesource/System/net/System/Net/Sockets/NetworkStream.cs:513  (TaskId:115)
        E/mono    ( 4120):    --- End of inner exception stack trace --- (TaskId:115)
        E/mono    ( 4120):   at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x000c3] in /Users/builder/jenkins/workspace/xamarin-android/xamarin-android/external/mono/mcs/class/referencesource/System/net/System/Net/Sockets/NetworkStream.cs:525  (TaskId:115)
        ...
        E/mono    ( 4120):   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in /Users/builder/jenkins/workspace/xamarin-android/xamarin-android/external/mono/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs:1213  (TaskId:115)
        ...
        I/Zygote  ( 1145): Process 4120 exited cleanly (255) (TaskId:115)

This is not a "normally catchable" exception -- it's happening on the
ThreadPool -- so our current hypothesis/prayer is that updating xUnit
to a newer version will "magically fix things" by xUnit having code
to prevent unhandled exceptions from the ThreadPool.

Even if that doesn't work, we should be using a newer xUnit anyway,
so no harm in bumping.

[0]: https://jenkins.mono-project.com/job/xamarin-android-pr-builder/3574/
  • Loading branch information
grendello authored and jonpryor committed Jul 18, 2018
1 parent b4abdd9 commit ab70b2d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions tests/TestRunner.xUnit/TestRunner.xUnit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
<Reference Include="System.IO.Compression" />
<Reference Include="System.Net.Http" />
<Reference Include="xunit.abstractions">
<HintPath>..\..\packages\xunit.abstractions.2.0.1\lib\netstandard1.0\xunit.abstractions.dll</HintPath>
<HintPath>..\..\packages\xunit.abstractions.2.0.2\lib\netstandard2.0\xunit.abstractions.dll</HintPath>
</Reference>
<Reference Include="xunit.runner.utility.netstandard15">
<HintPath>..\..\packages\xunit.runner.utility.2.3.1\lib\netstandard1.5\xunit.runner.utility.netstandard15.dll</HintPath>
<Reference Include="xunit.runner.utility.netstandard20">
<HintPath>..\..\packages\xunit.runner.utility.2.4.0\lib\netstandard2.0\xunit.runner.utility.netstandard20.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -76,5 +76,5 @@
<EmbeddedResource Include="NUnitXml.xslt" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<Import Project="..\..\packages\NETStandard.Library.2.0.1\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\..\packages\NETStandard.Library.2.0.1\build\netstandard2.0\NETStandard.Library.targets')" />
<Import Project="..\..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
</Project>
14 changes: 7 additions & 7 deletions tests/TestRunner.xUnit/packages.config
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.NETCore.Platforms" version="2.0.1" targetFramework="monoandroid81" />
<package id="Microsoft.NETCore.Platforms" version="2.1.0" targetFramework="monoandroid81" />
<package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="monoandroid80" />
<package id="NETStandard.Library" version="2.0.1" targetFramework="monoandroid80" />
<package id="NETStandard.Library" version="2.0.3" targetFramework="monoandroid81" />
<package id="System.AppContext" version="4.3.0" targetFramework="monoandroid80" />
<package id="System.Collections" version="4.3.0" targetFramework="monoandroid80" />
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="monoandroid80" />
<package id="System.Console" version="4.3.0" targetFramework="monoandroid80" />
<package id="System.Console" version="4.3.1" targetFramework="monoandroid81" />
<package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="monoandroid80" />
<package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="monoandroid80" />
<package id="System.Diagnostics.Tracing" version="4.3.0" targetFramework="monoandroid80" />
Expand All @@ -26,7 +26,7 @@
<package id="System.Reflection" version="4.3.0" targetFramework="monoandroid80" />
<package id="System.Reflection.Extensions" version="4.3.0" targetFramework="monoandroid80" />
<package id="System.Reflection.Primitives" version="4.3.0" targetFramework="monoandroid80" />
<package id="System.Reflection.TypeExtensions" version="4.4.0" targetFramework="monoandroid80" />
<package id="System.Reflection.TypeExtensions" version="4.5.0" targetFramework="monoandroid81" />
<package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="monoandroid80" />
<package id="System.Runtime" version="4.3.0" targetFramework="monoandroid80" />
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="monoandroid80" />
Expand All @@ -44,8 +44,8 @@
<package id="System.Threading" version="4.3.0" targetFramework="monoandroid80" />
<package id="System.Threading.Tasks" version="4.3.0" targetFramework="monoandroid80" />
<package id="System.Threading.Timer" version="4.3.0" targetFramework="monoandroid80" />
<package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="monoandroid80" />
<package id="System.Xml.ReaderWriter" version="4.3.1" targetFramework="monoandroid81" />
<package id="System.Xml.XDocument" version="4.3.0" targetFramework="monoandroid80" />
<package id="xunit.abstractions" version="2.0.1" targetFramework="monoandroid80" />
<package id="xunit.runner.utility" version="2.3.1" targetFramework="monoandroid80" />
<package id="xunit.abstractions" version="2.0.2" targetFramework="monoandroid81" />
<package id="xunit.runner.utility" version="2.4.0" targetFramework="monoandroid81" />
</packages>

0 comments on commit ab70b2d

Please sign in to comment.