-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[wasm][tests] Fix test failures due to trimming #51697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsThis is just to validate some fixes
|
01e04e9 to
1ba5358
Compare
Issue: dotnet#51602 `System.ObjectModel.Tests` `System.ComponentModel.Primitives` `System.ComponentModel.TypeConverter.Tests`
…LoadContext
The test project explicitly copies, and needs `mscorlib.dll`, which gets
trimmed out with `EnableAggressiveTrimming=true`. Preserve that.
```
error MSB3030: Could not copy the file "/__w/1/s/artifacts/bin/System.Reflection.MetadataLoadContext.Tests/net6.0-Release/browser-wasm/publish/mscorlib.dll" because it was not found.
[/__w/1/s/src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj]
```
This depends on pdb files, which are included only if
`DebuggerSupport==true`, but that is set to false by default for tests.
Override that for this project.
```
error MSB3030: Could not copy the file "/__w/1/s/artifacts/bin/System.Reflection.Tests/net6.0-Release/browser-wasm/publish/System.Reflection.Tests.pdb" because it was not found.
[/__w/1/s/src/libraries/System.Reflection/tests/System.Reflection.Tests.csproj]
```
1ba5358 to
7f65c2b
Compare
Specifically `System.Text.Tests.EncodingTests`. ``` fail: [FAIL] System.Text.Tests.EncodingTests.GetEncoding_FromProvider_ByCodePage_WithDisallowedEncoding_Throws(encodingName: "utf-7", codePage: 65000) (TaskId:531) info: System.ArgumentNullException : Value cannot be null. (Parameter 'method') (TaskId:531) info: at Castle.DynamicProxy.Generators.Emitters.SimpleAST.ConstructorInvocationStatement..ctor(ConstructorInfo method, Expression[] args) (TaskId:531) info: at Castle.DynamicProxy.Generators.Emitters.CodeBuilders.ConstructorCodeBuilder.InvokeBaseConstructor(ConstructorInfo constructor, ArgumentReference[] arguments) (TaskId:531) info: at Castle.DynamicProxy.Generators.InvocationTypeGenerator.CreateConstructor(AbstractTypeEmitter invocation, ProxyGenerationOptions options) (TaskId:531) info: at Castle.DynamicProxy.Generators.InvocationTypeGenerator.Generate(ClassEmitter class, ProxyGenerationOptions options, INamingScope namingScope) (TaskId:531) info: at Castle.DynamicProxy.Contributors.ClassProxyTargetContributor.BuildInvocationType(MetaMethod method, ClassEmitter class, ProxyGenerationOptions options) (TaskId:531) info: at Castle.DynamicProxy.Contributors.ClassProxyTargetContributor.GetInvocationType(MetaMethod method, ClassEmitter class, ProxyGenerationOptions options) (TaskId:531) info: at Castle.DynamicProxy.Contributors.ClassProxyTargetContributor.GetMethodGenerator(MetaMethod method, ClassEmitter class, ProxyGenerationOptions options, OverrideMethodDelegate overrideMethod) (TaskId:531) info: at Castle.DynamicProxy.Contributors.CompositeTypeContributor.ImplementMethod(MetaMethod method, ClassEmitter class, ProxyGenerationOptions options, OverrideMethodDelegate overrideMethod) (TaskId:531) info: at Castle.DynamicProxy.Contributors.CompositeTypeContributor.Generate(ClassEmitter class, ProxyGenerationOptions options) (TaskId:531) info: at Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateType(String name, Type[] interfaces, INamingScope namingScope) (TaskId:531) info: at Castle.DynamicProxy.Generators.ClassProxyGenerator.<>c__DisplayClass1_0.<GenerateCode>b__0(String n, INamingScope s) (TaskId:531) info: at Castle.DynamicProxy.Generators.BaseProxyGenerator.<>c__DisplayClass33_0.<ObtainProxyType>b__0(CacheKey _) (TaskId:531) info: at Castle.Core.Internal.SynchronizedDictionary`2[[Castle.DynamicProxy.Generators.CacheKey, Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc],[System.Type, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].GetOrAdd(CacheKey key, Func`2 valueFactory) (TaskId:531) info: at Castle.DynamicProxy.Generators.BaseProxyGenerator.ObtainProxyType(CacheKey cacheKey, Func`3 factory) (TaskId:531) info: at Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateCode(Type[] interfaces, ProxyGenerationOptions options) (TaskId:531) info: at Castle.DynamicProxy.DefaultProxyBuilder.CreateClassProxyType(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options) (TaskId:531) info: at Castle.DynamicProxy.ProxyGenerator.CreateClassProxyType(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options) (TaskId:531) info: at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, Object[] constructorArguments, IInterceptor[] interceptors) (TaskId:531) info: at Moq.CastleProxyFactory.CreateProxy(Type mockType, IInterceptor interceptor, Type[] interfaces, Object[] arguments) (TaskId:531) info: at Moq.Mock`1[[System.Text.Encoding, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].InitializeInstance() (TaskId:531) info: at Moq.Mock`1[[System.Text.Encoding, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].OnGetObject() (TaskId:531) info: at Moq.Mock.get_Object() (TaskId:531) info: at Moq.Mock`1[[System.Text.Encoding, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].get_Object() (TaskId:531) info: at System.Text.Tests.EncodingTests.GetEncoding_FromProvider_ByCodePage_WithDisallowedEncoding_Throws(String encodingName, Int32 codePage) in /Users/radical/dev/r3/src/libraries/System.Runtime/tests/System/Text/EncodingTests.cs:line 42 (TaskId:531) info: at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in /Users/radical/dev/r3/src/mono/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs:line 378 (TaskId:531) ```
…a.Tests.TagToTokenTests.ValidateTagToTokenConversion ``` [07:29:18] fail: [FAIL] System.Reflection.Metadata.Tests.TagToTokenTests.ValidateTagToTokenConversion [07:29:18] info: System.NullReferenceException : Object reference not set to an instance of an object. [07:29:18] info: at System.Reflection.Metadata.Tests.TagToTokenTests.<>c__DisplayClass1_0.<GetTags>b__3() [07:29:18] info: at System.Reflection.Metadata.Tests.TagToTokenTests.ValidateTagToTokenConversion() [07:29:18] info: at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) ``` Issue: dotnet#50714
.. and: - Microsoft.Extensions.Configuration.FileExtensions - Microsoft.Extensions.Configuration - Microsoft.Extensions.FileProviders.Composite - Microsoft.Extensions.Logging - Microsoft.Extensions.Primitives - Microsoft.Extensions.Http.Tests Fixes dotnet#50709 Example failures: ``` [02:19:11] fail: [FAIL] Microsoft.Extensions.Logging.Test.LoggerFactoryTest.CreateDisposeDisposesInnerServiceProvider [02:19:11] 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. [02:19:11] info: at Castle.DynamicProxy.Generators.InterfaceProxyWithTargetGenerator.ThrowInvalidBaseType(Type type, String doesNotHaveAccessibleParameterlessConstructor) [02:19:11] info: at Castle.DynamicProxy.Generators.InterfaceProxyWithTargetGenerator.EnsureValidBaseType(Type type) [02:19:11] info: at Castle.DynamicProxy.Generators.InterfaceProxyWithTargetGenerator.GenerateCode(Type proxyTargetType, Type[] interfaces, ProxyGenerationOptions options) [02:19:11] info: at Castle.DynamicProxy.DefaultProxyBuilder.CreateInterfaceProxyTypeWithoutTarget(Type interfaceToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options) [02:19:11] info: at Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyTypeWithoutTarget(Type interfaceToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options) [02:19:11] info: at Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget(Type interfaceToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, IInterceptor[] interceptors) [02:19:11] info: at Moq.CastleProxyFactory.CreateProxy(Type mockType, IInterceptor interceptor, Type[] interfaces, Object[] arguments) [02:19:11] info: at Moq.Mock`1[[Microsoft.Extensions.Logging.ILoggerProvider, Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].InitializeInstance() [02:19:11] info: at Moq.Mock`1[[Microsoft.Extensions.Logging.ILoggerProvider, Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].OnGetObject() [02:19:11] info: at Moq.Mock.get_Object() [02:19:11] info: at Moq.Mock`1[[Microsoft.Extensions.Logging.ILoggerProvider, Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].get_Object() [02:19:11] info: at Microsoft.Extensions.Logging.Test.LoggerFactoryTest.<>c__DisplayClass20_0.<CreateDisposeDisposesInnerServiceProvider>b__3(IServiceProvider _) [02:19:11] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context) [02:19:11] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSiteMain(ServiceCallSite callSite, RuntimeResolverContext argument) [02:19:11] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.ResolveService(ServiceCallSite callSite, RuntimeResolverContext context, RuntimeResolverLock lockType, ServiceProviderEngineScope serviceProviderEngine) [02:19:11] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) [02:19:11] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSite(ServiceCallSite callSite, RuntimeResolverContext argument) [02:19:11] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context) [02:19:11] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSiteMain(ServiceCallSite callSite, RuntimeResolverContext argument) [02:19:11] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.ResolveService(ServiceCallSite callSite, RuntimeResolverContext context, RuntimeResolverLock lockType, ServiceProviderEngineScope serviceProviderEngine) [02:19:11] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) [02:19:12] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSite(ServiceCallSite callSite, RuntimeResolverContext argument) [02:19:12] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) [02:19:12] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.Depende ncyInjection, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSiteMain(S erviceCallSite callSite, RuntimeResolverContext argument) [02:19:12] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.ResolveService(ServiceCallSite callSite, RuntimeResolverContext context, RuntimeResolverLock lockType, ServiceProviderEngineScope serviceProviderEngine) [02:19:12] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) [02:19:12] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.Depende ncyInjection, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSite(Servi ceCallSite callSite, RuntimeResolverContext argument) [02:19:12] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) [02:19:12] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__1(ServiceProviderEngineScope p) [02:19:12] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope) [02:19:12] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope) [02:19:12] info: at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType) [02:19:12] info: at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType) [02:19:12] info: at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[ILoggerFactory](IServiceProvider provider) [02:19:12] info: at Microsoft.Extensions.Logging.LoggerFactory.Create(Action`1 configure) [02:19:12] info: at Microsoft.Extensions.Logging.Test.LoggerFactoryTest.CreateDisposeDisposesInnerServiceProvider() [02:19:12] info: at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) ```
Dependent assemblies getting trimmed out.
`TestAssembly` gets trimmed causing errors like: ``` fail: [FAIL] System.Reflection.Tests.AssemblyTests.CreateInstance_Invalid(typeName: null, exceptionType: typeof(System.ArgumentNullException)) info: System.IO.FileNotFoundException : Could not find file '/TestAssembly.dll'. ```
e58340f to
1920a6b
Compare
1920a6b to
18cc028
Compare
18cc028 to
1b80ac6
Compare
|
Both EAT, and AOT builds are green now, all the (enabled) tests passing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Can we do an immediate follow up with xml comments that point to the issue/reason the changes were added?
Both EAT, and AOT builds are completely green now.
Number of tests for EAT goes from 147 -> 185
Number of tests for AOT goes from 147 -> 174 (the difference is because of aot only failures)
Test run on a regular wasm build runs 206 libraries