-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
In effort to run library tests with AOT compilation on CI #46633, there are a number of failures arising from #46651.
Test suite Microsoft.Extensions.Primitives/tests/Microsoft.Extensions.Primitives.Tests.csproj fails with
fail: [FAIL] Microsoft.Extensions.Primitives.CompositeChangeTokenTest.HasChanged_IsTrue_IfAnyTokenHasChanged
info: System.ArgumentException : Type Moq.Internals.InterfaceProxy is not valid base type for interface proxy, because it does not have accessible parameterless constructor. Only a non-sealed class with non-private default constructor can be used as base type for interface proxy. Please use some other valid type.
info:
fail: [FAIL] Microsoft.Extensions.Primitives.CompositeChangeTokenTest.RegisteredCallbacks_AreInvokedExactlyOnce
info: System.ExecutionEngineException : AOT Compilation failed for method 'void System.Threading.CancellationTokenSource:ExecuteCallbackHandlers (bool)'.
info:
fail: [FAIL] Microsoft.Extensions.Primitives.CompositeChangeTokenTest.HasChanged_IsFalse_IfNoTokenHasChanged
info: System.ArgumentException : Type Moq.Internals.InterfaceProxy is not valid base type for interface proxy, because it does not have accessible parameterless constructor. Only a non-sealed class with non-private default constructor can be used as base type for interface proxy. Please use some other valid type.
info:
fail: [FAIL] Microsoft.Extensions.Primitives.CompositeChangeTokenTest.ActiveChangeCallbacks_IsFalse_IfNoTokenHasActiveChangeCallbacks
info: System.ArgumentException : Type Moq.Internals.InterfaceProxy is not valid base type for interface proxy, because it does not have accessible parameterless constructor. Only a non-sealed class with non-private default constructor can be used as base type for interface proxy. Please use some other valid type.
info:
fail: [FAIL] Microsoft.Extensions.Primitives.CompositeChangeTokenTest.ActiveChangeCallbacks_IsTrue_IfAnyTokenHasActiveChangeCallbacks
info: System.ArgumentException : Type Moq.Internals.InterfaceProxy is not valid base type for interface proxy, because it does not have accessible parameterless constructor. Only a non-sealed class with non-private default constructor can be used as base type for interface proxy. Please use some other valid type.
Microsoft_extensions_primitives_fail.txt
Repro:
Check out changes in
4f17c4e without this, many tests are not discovered.
4e7ab85 this one helps avoid some AOT compilation errors with this exception filter. There shouldn't be exception filter issues anymore.
./build.sh -os Browser -arch wasm -c Release
./dotnet.sh build /t:Test /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=Release /p:EnableAggressiveTrimming=true /p:RunAOTCompilation=true src/libraries/Microsoft.Extensions.Primitives/tests/Microsoft.Extensions.Primitives.Tests.csproj