Skip to content

Conversation

@radical
Copy link
Member

@radical radical commented Apr 22, 2021

  • 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

@radical radical added arch-wasm WebAssembly architecture area-Build-mono trimming-for-aot `EnableAggressiveTrimming=true` used for running tests with AOT labels Apr 22, 2021
@ghost
Copy link

ghost commented Apr 22, 2021

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

This is just to validate some fixes

Author: radical
Assignees: -
Labels:

arch-wasm, area-Build-mono, trimming-for-aot

Milestone: -

@radical radical force-pushed the test-trimming-for-aot branch from 01e04e9 to 1ba5358 Compare April 22, 2021 23:23
radical added 5 commits April 22, 2021 19:25
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]
```
@radical radical force-pushed the test-trimming-for-aot branch from 1ba5358 to 7f65c2b Compare April 22, 2021 23:25
radical added 11 commits April 24, 2021 01:57
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'.
```
@radical radical force-pushed the test-trimming-for-aot branch 2 times, most recently from e58340f to 1920a6b Compare April 26, 2021 02:23
@radical radical changed the title [IGNORE][wasm] testing, and fixing trimming issues in AOT tests [wasm][tests] Fix test failures due to trimming Apr 26, 2021
@radical radical force-pushed the test-trimming-for-aot branch from 1920a6b to 18cc028 Compare April 26, 2021 06:21
@radical radical marked this pull request as ready for review April 26, 2021 08:28
@radical radical force-pushed the test-trimming-for-aot branch from 18cc028 to 1b80ac6 Compare April 26, 2021 08:38
@radical
Copy link
Member Author

radical commented Apr 28, 2021

Both EAT, and AOT builds are green now, all the (enabled) tests passing.

@lewing @steveisok @SamMonoRT

Copy link
Member

@lewing lewing left a 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?

@radical radical merged commit f372f6b into dotnet:main Apr 28, 2021
@radical radical deleted the test-trimming-for-aot branch April 28, 2021 19:19
radical added a commit to radical/runtime that referenced this pull request Apr 28, 2021
@karelz karelz modified the milestones: 5.0.x, 6.0.0 May 20, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasm WebAssembly architecture area-Build-mono trimming-for-aot `EnableAggressiveTrimming=true` used for running tests with AOT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants