Skip to content

[trimming] System.Diagnostics trimming out DebuggerTypeProxyAttribute. #57588

Open

Description

@lewing
[01:53:09] fail: [FAIL] System.Collections.ObjectModel.Tests.ReadOnlyDictionaryTests.DebuggerAttribute_NullDictionary_ThrowsArgumentNullException
[01:53:09] info: Assert.Throws() Failure
[01:53:09] info: Expected: typeof(System.Reflection.TargetInvocationException)
[01:53:09] info: Actual:   typeof(System.InvalidOperationException): Expected one DebuggerTypeProxyAttribute on System.Collections.ObjectModel.ReadOnlyDictionary`2[System.Int32,System.Int32].
[01:53:09] info: ---- System.InvalidOperationException : Expected one DebuggerTypeProxyAttribute on System.Collections.ObjectModel.ReadOnlyDictionary`2[System.Int32,System.Int32].
[01:53:09] info:    at System.Diagnostics.DebuggerAttributes.GetProxyType(Type type, Type[] genericTypeArguments)
[01:53:09] info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerTypeProxyProperties(Type type, Type[] genericTypeArguments, Object obj)
[01:53:09] info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerTypeProxyProperties(Type type, Object obj)
[01:53:09] info:    at System.Collections.ObjectModel.Tests.ReadOnlyDictionaryTests.<>c.<DebuggerAttribute_NullDictionary_ThrowsArgumentNullException>b__13_0()
[01:53:09] info: ----- Inner Stack Trace -----
[01:53:09] info:    at System.Diagnostics.DebuggerAttributes.GetProxyType(Type type, Type[] genericTypeArguments)
[01:53:09] info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerTypeProxyProperties(Type type, Type[] genericTypeArguments, Object obj)
[01:53:09] info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerTypeProxyProperties(Type type, Object obj)
[01:53:09] info:    at System.Collections.ObjectModel.Tests.ReadOnlyDictionaryTests.<>c.<DebuggerAttribute_NullDictionary_ThrowsArgumentNullException>b__13_0()
[01:53:09] fail: [FAIL] System.Collections.ObjectModel.Tests.ReadOnlyDictionaryTests.DebuggerAttribute_NullDictionaryKeys_ThrowsArgumentNullException
[01:53:09] info: Assert.Throws() Failure
[01:53:09] info: Expected: typeof(System.Reflection.TargetInvocationException)
[01:53:09] info: Actual:   typeof(System.InvalidOperationException): Expected one DebuggerTypeProxyAttribute on System.Collections.ObjectModel.ReadOnlyDictionary`2+KeyCollection[System.Int32,System.Int32].
[01:53:09] info: ---- System.InvalidOperationException : Expected one DebuggerTypeProxyAttribute on System.Collections.ObjectModel.ReadOnlyDictionary`2+KeyCollection[System.Int32,System.Int32].
[01:53:09] info:    at System.Diagnostics.DebuggerAttributes.GetProxyType(Type type, Type[] genericTypeArguments)
[01:53:09] info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerTypeProxyProperties(Type type, Type[] genericTypeArguments, Object obj)
[01:53:09] info:    at System.Collections.ObjectModel.Tests.ReadOnlyDictionaryTests.<>c.<DebuggerAttribute_NullDictionaryKeys_ThrowsArgumentNullException>b__14_0()
[01:53:09] info: ----- Inner Stack Trace -----
[01:53:09] info:    at System.Diagnostics.DebuggerAttributes.GetProxyType(Type type, Type[] genericTypeArguments)
[01:53:09] info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerTypeProxyProperties(Type type, Type[] genericTypeArguments, Object obj)
[01:53:09] info:    at System.Collections.ObjectModel.Tests.ReadOnlyDictionaryTests.<>c.<DebuggerAttribute_NullDictionaryKeys_ThrowsArgumentNullException>b__14_0()
[01:53:09] fail: [FAIL] System.Collections.ObjectModel.Tests.ReadOnlyDictionaryTests.DebuggerAttributeTests
[01:53:09] info: System.InvalidOperationException : Expected one DebuggerDisplayAttribute on System.Collections.ObjectModel.ReadOnlyDictionary`2[System.Int32,System.Int32].
[01:53:09] info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerDisplayReferences(Object obj)
[01:53:09] info:    at System.Collections.ObjectModel.Tests.ReadOnlyDictionaryTests.DebuggerAttributeTests()
[01:53:09] info:    at System.Reflection.RuntimeMethodInfo.Invoke(Object , BindingFlags , Binder , Object[] , CultureInfo )
[01:53:09] fail: [FAIL] System.Collections.ObjectModel.Tests.ConstructorAndPropertyTests.DebuggerAttributeTests
[01:53:09] info: System.InvalidOperationException : Expected one DebuggerDisplayAttribute on System.Collections.ObjectModel.ObservableCollection`1[System.Int32].
[01:53:09] info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerDisplayReferences(Object obj)
[01:53:09] info:    at System.Collections.ObjectModel.Tests.ConstructorAndPropertyTests.DebuggerAttributeTests()
[01:53:09] info:    at System.Reflection.RuntimeMethodInfo.Invoke(Object , BindingFlags , Binder , Object[] , CultureInfo )
[01:53:09] fail: [FAIL] System.Collections.ObjectModel.Tests.ConstructorAndPropertyTests.DebuggerAttribute_NullCollection_ThrowsArgumentNullException
[01:53:09] info: Assert.Throws() Failure
[01:53:09] info: Expected: typeof(System.Reflection.TargetInvocationException)
[01:53:09] info: Actual:   typeof(System.InvalidOperationException): Expected one DebuggerTypeProxyAttribute on System.Collections.ObjectModel.ObservableCollection`1[System.Int32].
[01:53:09] info: ---- System.InvalidOperationException : Expected one DebuggerTypeProxyAttribute on System.Collections.ObjectModel.ObservableCollection`1[System.Int32].
[01:53:09] info:    at System.Diagnostics.DebuggerAttributes.GetProxyType(Type type, Type[] genericTypeArguments)
[01:53:09] info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerTypeProxyProperties(Type type, Type[] genericTypeArguments, Object obj)
[01:53:09] info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerTypeProxyProperties(Type type, Object obj)
[01:53:09] info:    at System.Collections.ObjectModel.Tests.ConstructorAndPropertyTests.<>c.<DebuggerAttribute_NullCollection_ThrowsArgumentNullException>b__11_0()
[01:53:09] info: ----- Inner Stack Trace -----
[01:53:09] info:    at System.Diagnostics.DebuggerAttributes.GetProxyType(Type type, Type[] genericTypeArguments)
[01:53:09] info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerTypeProxyProperties(Type type, Type[] genericTypeArguments, Object obj)
[01:53:09] info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerTypeProxyProperties(Type type, Object obj)
[01:53:09] info:    at System.Collections.ObjectModel.Tests.ConstructorAndPropertyTests.<>c.<DebuggerAttribute_NullCollection_ThrowsArgumentNullException>b__11_0()
[01:53:20] fail: [FAIL] System.Collections.ObjectModel.Tests.ObservableCollection_Serialization.OnDeserialized_MonitorNotInitialized_ExpectSuccess
[01:53:20] info: Assert.NotNull() Failure
[01:53:20] info:    at System.Collections.ObjectModel.Tests.ObservableCollection_Serialization.OnDeserialized_MonitorNotInitialized_ExpectSuccess()
[01:53:20] info:    at System.Reflection.RuntimeMethodInfo.Invoke(Object , BindingFlags , Binder , Object[] , CultureInfo )
[01:53:21] fail: [FAIL] System.Collections.ObjectModel.Tests.ReadOnlyObservableCollectionTests.DebuggerAttribute_Tests
[01:53:21] info: System.InvalidOperationException : Expected one DebuggerDisplayAttribute on System.Collections.ObjectModel.ReadOnlyObservableCollection`1[System.Int32].
[01:53:21] info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerDisplayReferences(Object obj)
[01:53:21] info:    at System.Collections.ObjectModel.Tests.ReadOnlyObservableCollectionTests.DebuggerAttribute_Tests()
[01:53:21] info:    at System.Reflection.RuntimeMethodInfo.Invoke(Object , BindingFlags , Binder , Object[] , CultureInfo )
[01:53:21] fail: [FAIL] System.Collections.ObjectModel.Tests.ReadOnlyObservableCollectionTests.DebuggerAttribute_NullCollection_ThrowsArgumentNullException
[01:53:21] info: Assert.Throws() Failure
[01:53:21] info: Expected: typeof(System.Reflection.TargetInvocationException)
[01:53:21] info: Actual:   typeof(System.InvalidOperationException): Expected one DebuggerTypeProxyAttribute on System.Collections.ObjectModel.ReadOnlyObservableCollection`1[System.Int32].
[01:53:21] info: ---- System.InvalidOperationException : Expected one DebuggerTypeProxyAttribute on System.Collections.ObjectModel.ReadOnlyObservableCollection`1[System.Int32].
[01:53:21] info:    at System.Diagnostics.DebuggerAttributes.GetProxyType(Type type, Type[] genericTypeArguments)
[01:53:21] info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerTypeProxyProperties(Type type, Type[] genericTypeArguments, Object obj)
[01:53:21] info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerTypeProxyProperties(Type type, Object obj)
[01:53:21] info:    at System.Collections.ObjectModel.Tests.ReadOnlyObservableCollectionTests.<>c.<DebuggerAttribute_NullCollection_ThrowsArgumentNullException>b__10_0()
[01:53:21] info: ----- Inner Stack Trace -----
[01:53:21] info:    at System.Diagnostics.DebuggerAttributes.GetProxyType(Type type, Type[] genericTypeArguments)
[01:53:21] info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerTypeProxyProperties(Type type, Type[] genericTypeArguments, Object obj)
[01:53:21] info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerTypeProxyProperties(Type type, Object obj)
[01:53:21] info:    at System.Collections.ObjectModel.Tests.ReadOnlyObservableCollectionTests.<>c.<DebuggerAttribute_NullCollection_ThrowsArgumentNullException>b__10_0()
[01:53:21] info: Finished:    System.ObjectModel.Tests.dll
[01:53:21] info: 
[01:53:21] info: === TEST EXECUTION SUMMARY ===
[01:53:21] info: Total: 2152, Errors: 0, Failed: 8, Skipped: 4, Time: 24.01992s

Activity

  1. added
    arch-wasm
    trimming-for-aot
    on Aug 17, 2021
  2. added this to the 7.0.0 milestone on Aug 17, 2021
  3. ghost added
    untriaged
    on Aug 17, 2021
  4. removed
    untriaged
    on Aug 17, 2021
  5. modified the milestones: 7.0.0, 8.0.0 on Jul 25, 2022
  6. jkotas commented on Aug 4, 2022

    @jkotas
    Member

    We have PlatformDetection.IsDebuggerTypeProxyAttributeSupported. If it is not done already, it should get wired in for wasm and the tests marked with it [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))].

  7. jkotas commented on Aug 4, 2022

    @jkotas
    Member

    Updating area label - the failing tests are under System.Collections.

  8. 14 remaining items

  9. reopened this on Jun 23, 2023
  10. removed
    needs-author-action
    on Jun 23, 2023
  11. ilonatommy commented on Jul 24, 2023

    @ilonatommy
    Member

    Still failing, I will take a look

  12. ilonatommy commented on Jul 24, 2023

    @ilonatommy
    Member

    I do not see a point to expect from Activator.CreateInstance(proxyType, obj) to throw when obj == null. When obj is null then the Activator uses the "the constructor that takes no parameters (the parameterless constructor)" and ObservableCollection has a parentless one. From this reason I am changing the expected behavior in the tests to throw when customAttributes.Lentgh != 1 (in the failing tests it's 0).

    edit: the change of exception type is not the right solution, instead we probably should not have 0 Length of custom attributes.

  13. ghost locked as resolved and limited conversation to collaborators on Sep 3, 2023
  14. changed the title [-][wasm][eat] System.Diagnostics trimming out DebuggerTypeProxyAttribute.[/-] [+][trimming] System.Diagnostics trimming out DebuggerTypeProxyAttribute.[/+] on Mar 12, 2024
  15. modified the milestones: 8.0.0, Future on Mar 12, 2024
  16. kotlarmilos commented on Mar 21, 2024

    @kotlarmilos
    Member

    The failures are still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arch-wasmarea-System.Collectionsdisabled-testos-iostest-failuretrimming-for-aot

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions