From d7db5ab9bd3ad449b18dd96b3ac37592b207205b Mon Sep 17 00:00:00 2001 From: Jan Vorlicek Date: Fri, 21 Jun 2019 14:21:34 +0200 Subject: [PATCH] Disable unloading incompatible test for runincontext (#25126) * Disable unloading incompatible test for runincontext These tests do various things that make them incompatible with running in an unloadable assembly load context using the runincontext tool. I've attached comments to the UnloadabilityIncompatible element describing the specific problems of each test. I've also found a problem in the parameter passing in the runincontext.sh where it was always passing 7 parameters to each test and tests that were checking the number of parameters were failing due to that. This change fixes it by passing just the parameters that were passed to the runincontext.sh. * Added printing unhandled exception details if it happened in the test * Added 10ms wait to the GC collection loop to also give time to async stuff to completely exit threadpool threads --- src/tools/runincontext/runincontext.cs | 2 ++ tests/scripts/runincontext.sh | 2 +- .../src/GC/Features/KeepAlive/keepaliveother/keepalivefinalize.csproj | 2 ++ tests/src/Interop/COM/Activator/Activator.csproj | 2 ++ tests/src/Interop/WinRT/NETClients/Bindings/NETClientBindings.csproj | 2 ++ .../Interop/WinRT/NETClients/Primitives/NETClientPrimitives.csproj | 4 +++- .../AssemblyLoadContext30Extensions.csproj | 2 ++ tests/src/Loader/ContextualReflection/ContextualReflection.csproj | 4 ++++ .../exceptions/regressions/V1/SEH/VJ/HandlerException.csproj | 2 ++ .../exceptions/regressions/V1/SEH/VJ/NestedException.csproj | 4 +++- 10 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/tools/runincontext/runincontext.cs b/src/tools/runincontext/runincontext.cs index 06aff6a..8b0d2ea 100644 --- a/src/tools/runincontext/runincontext.cs +++ b/src/tools/runincontext/runincontext.cs @@ -483,6 +483,7 @@ public class TestRunner { GC.Collect(); GC.WaitForPendingFinalizers(); + Thread.Sleep(10); } if (_input.BreakAfterRun) @@ -562,6 +563,7 @@ public class RunInContext private static void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) { + Console.WriteLine($"RunInContext FAIL! Exiting due to unhandled exception in the test: {e.ExceptionObject}"); Environment.Exit(FailureExitCode); } diff --git a/tests/scripts/runincontext.sh b/tests/scripts/runincontext.sh index fa9db00..8e36564 100755 --- a/tests/scripts/runincontext.sh +++ b/tests/scripts/runincontext.sh @@ -14,4 +14,4 @@ # 3. - n. Additional arguments that were passed to the test .sh export CORE_LIBRARIES=$1 -$_DebuggerFullPath "$CORE_ROOT/corerun" "$CORE_ROOT/runincontext.dll" $RunInContextExtraArgs /referencespath:$CORE_ROOT/ $1$2 $3 $4 $5 $6 $7 $8 $9 +$_DebuggerFullPath "$CORE_ROOT/corerun" "$CORE_ROOT/runincontext.dll" $RunInContextExtraArgs /referencespath:$CORE_ROOT/ $1$2 "${@:3}" diff --git a/tests/src/GC/Features/KeepAlive/keepaliveother/keepalivefinalize.csproj b/tests/src/GC/Features/KeepAlive/keepaliveother/keepalivefinalize.csproj index 86a73c6..4ca5060 100644 --- a/tests/src/GC/Features/KeepAlive/keepaliveother/keepalivefinalize.csproj +++ b/tests/src/GC/Features/KeepAlive/keepaliveother/keepalivefinalize.csproj @@ -11,6 +11,8 @@ ..\..\ true 1 + + true diff --git a/tests/src/Interop/COM/Activator/Activator.csproj b/tests/src/Interop/COM/Activator/Activator.csproj index 51b0b73..9310c91 100644 --- a/tests/src/Interop/COM/Activator/Activator.csproj +++ b/tests/src/Interop/COM/Activator/Activator.csproj @@ -12,6 +12,8 @@ true true + + true diff --git a/tests/src/Interop/WinRT/NETClients/Bindings/NETClientBindings.csproj b/tests/src/Interop/WinRT/NETClients/Bindings/NETClientBindings.csproj index 1eed534..a18f74b 100644 --- a/tests/src/Interop/WinRT/NETClients/Bindings/NETClientBindings.csproj +++ b/tests/src/Interop/WinRT/NETClients/Bindings/NETClientBindings.csproj @@ -13,6 +13,8 @@ true true true + + true diff --git a/tests/src/Interop/WinRT/NETClients/Primitives/NETClientPrimitives.csproj b/tests/src/Interop/WinRT/NETClients/Primitives/NETClientPrimitives.csproj index 990f513..e2c5a97 100644 --- a/tests/src/Interop/WinRT/NETClients/Primitives/NETClientPrimitives.csproj +++ b/tests/src/Interop/WinRT/NETClients/Primitives/NETClientPrimitives.csproj @@ -12,7 +12,9 @@ true true - + + true + diff --git a/tests/src/Loader/AssemblyLoadContext30Extensions/AssemblyLoadContext30Extensions.csproj b/tests/src/Loader/AssemblyLoadContext30Extensions/AssemblyLoadContext30Extensions.csproj index d9cef87..27154b4 100644 --- a/tests/src/Loader/AssemblyLoadContext30Extensions/AssemblyLoadContext30Extensions.csproj +++ b/tests/src/Loader/AssemblyLoadContext30Extensions/AssemblyLoadContext30Extensions.csproj @@ -10,6 +10,8 @@ Exe {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} ..\..\ + + true diff --git a/tests/src/Loader/ContextualReflection/ContextualReflection.csproj b/tests/src/Loader/ContextualReflection/ContextualReflection.csproj index 6f88de3..27dd6ee 100644 --- a/tests/src/Loader/ContextualReflection/ContextualReflection.csproj +++ b/tests/src/Loader/ContextualReflection/ContextualReflection.csproj @@ -8,6 +8,10 @@ Exe BuildAndRun {78030DC5-F1A6-4B98-A130-A66F5047FF29} + + true diff --git a/tests/src/baseservices/exceptions/regressions/V1/SEH/VJ/HandlerException.csproj b/tests/src/baseservices/exceptions/regressions/V1/SEH/VJ/HandlerException.csproj index 96e6642..24653a7 100644 --- a/tests/src/baseservices/exceptions/regressions/V1/SEH/VJ/HandlerException.csproj +++ b/tests/src/baseservices/exceptions/regressions/V1/SEH/VJ/HandlerException.csproj @@ -12,6 +12,8 @@ true BuildAndRun 1 + + true diff --git a/tests/src/baseservices/exceptions/regressions/V1/SEH/VJ/NestedException.csproj b/tests/src/baseservices/exceptions/regressions/V1/SEH/VJ/NestedException.csproj index 5f52ad7..8484c97 100644 --- a/tests/src/baseservices/exceptions/regressions/V1/SEH/VJ/NestedException.csproj +++ b/tests/src/baseservices/exceptions/regressions/V1/SEH/VJ/NestedException.csproj @@ -12,7 +12,9 @@ true BuildAndRun 1 - + + true + -- 2.7.4