From 48cc987537ea72ed43842c13d7cfd2226cb76624 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 12 Jun 2026 14:09:17 +0000 Subject: [PATCH 1/2] Fix order-dependent assertion in PolymorphicTests on Mono/tvOS The test MetadataServices_NullPolymorphismOptions_DoesNotActivateAttributeClassifier used Assert.Collection which assumes a specific ordering of DerivedTypes. However, the .NET spec does not guarantee the order of custom attributes returned by reflection, and Mono returns them in a different order than CoreCLR. Replace the order-dependent Assert.Collection with Assert.Equal(2, ...) + Assert.Contains to make the test pass regardless of attribute enumeration order. This removes the need for the [ActiveIssue] that was disabling the test on Apple mobile Mono platforms. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../PolymorphicTests.TypeClassifier.cs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/PolymorphicTests.TypeClassifier.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/PolymorphicTests.TypeClassifier.cs index b8b7f26243f291..2763d73d06d6ab 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/PolymorphicTests.TypeClassifier.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/PolymorphicTests.TypeClassifier.cs @@ -741,7 +741,6 @@ public void MetadataServices_NullPolymorphismOptions_ReadsAttributes() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/128765", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsMonoRuntime))] public void MetadataServices_NullPolymorphismOptions_DoesNotActivateAttributeClassifier() { JsonTypeInfo typeInfo = JsonMetadataServices.CreateObjectInfo( @@ -752,18 +751,9 @@ public void MetadataServices_NullPolymorphismOptions_DoesNotActivateAttributeCla }); JsonPolymorphismOptions options = Assert.IsType(typeInfo.PolymorphismOptions); - Assert.Collection( - options.DerivedTypes, - derivedType => - { - Assert.Equal(typeof(AttrClassifiedDog), derivedType.DerivedType); - Assert.Equal("dog", derivedType.TypeDiscriminator); - }, - derivedType => - { - Assert.Equal(typeof(AttrClassifiedCat), derivedType.DerivedType); - Assert.Equal("cat", derivedType.TypeDiscriminator); - }); + Assert.Equal(2, options.DerivedTypes.Count); + Assert.Contains(options.DerivedTypes, dt => dt.DerivedType == typeof(AttrClassifiedDog) && Equals("dog", dt.TypeDiscriminator)); + Assert.Contains(options.DerivedTypes, dt => dt.DerivedType == typeof(AttrClassifiedCat) && Equals("cat", dt.TypeDiscriminator)); Assert.Null(typeInfo.TypeClassifier); } From a4527f40f9e1ced9cd67ab092bd319336eede9c2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 12 Jun 2026 14:09:23 +0000 Subject: [PATCH 2/2] ci: trigger checks