Skip to content

Commit 2e8b6f0

Browse files
kotlarmilosCopilot
andauthored
[clr-ios] Clear stale Apple mobile CoreCLR test exclusions (#128408)
## Description Reduces the Apple-mobile CoreCLR test exclusions tracked under #124344, based on`runtime-extra-platforms` (build 1429699): **Projects that now run on iossim / tvossim / maccatalyst CoreCLR:** - `System.Reflection.InvokeEmit.Tests` - `System.Reflection.InvokeInterpreted.Tests` - `System.Memory.Tests` **Per-test `[ActiveIssue]` decorations removed:** - `DiagnosticMethodInfoTests`, `CharReaderTests`, `XmlSerializerTests`, - `XslCompiledTransform`, `XsltApiV2`, `InvokeWithRefLikeArgs` **Workaround landed:** - `DCS_DeeplyLinkedData` now runs on a 16 MB-stack worker thread, so the 513-deep linked chain no longer exhausts the iOS default ~512 KB main-thread stack. The underlying `DataContractSerializer` dynamic-method recursion depth is unchanged. Contributes to #124344 Fixes #127463 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c4977a3 commit 2e8b6f0

7 files changed

Lines changed: 41 additions & 24 deletions

File tree

src/libraries/System.Diagnostics.StackTrace/tests/DiagnosticMethodInfoTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public static IEnumerable<object[]> Create_OpenDelegate_TestData()
7171
}
7272

7373
[Theory]
74-
[ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))]
7574
[MemberData(nameof(Create_OpenDelegate_TestData))]
7675
public void Create_OpenDelegate(Delegate del, string expectedName, string expectedTypeName)
7776
{

src/libraries/System.Numerics.Tensors/tests/TensorPrimitives.Generic.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,6 @@ public void SpanDestinationFunctions_SpecialValues(SpanDestinationDelegate tenso
571571

572572
[Theory]
573573
[MemberData(nameof(SpanDestinationFunctionsToTest))]
574-
[ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))]
575574
public void SpanDestinationFunctions_ValueRange(SpanDestinationDelegate tensorPrimitivesMethod, Func<T, T> expectedMethod, T? tolerance = null)
576575
{
577576
Assert.All(VectorLengthAndIteratedRange(ConvertFromSingle(-100f), ConvertFromSingle(100f), ConvertFromSingle(3f)), arg =>

src/libraries/System.Private.Xml/tests/Readers/CharCheckingReader/CharReaderTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ public partial class CharCheckingReaderTest : CGenericTestModule
1111
{
1212
[Theory]
1313
[XmlTests(nameof(Create))]
14-
[ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))]
1514
public void RunTests(XunitTestCase testCase)
1615
{
1716
testCase.Run();

src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2689,7 +2689,6 @@ public static void Xml_TypeWithSpecialCharacterInStringMember()
26892689
#endif
26902690
[ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)]
26912691
[ActiveIssue("https://github.com/dotnet/runtime/issues/95928", typeof(PlatformDetection), nameof(PlatformDetection.IsReadyToRunCompiled))]
2692-
[ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))]
26932692
public static void Xml_TypeInCollectibleALC()
26942693
{
26952694
ExecuteAndUnload("SerializableAssembly.dll", "SerializationTypes.SimpleType", out var weakRef);

src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
using Xunit;
2121
using System.Runtime.Serialization.Tests;
2222
using System.Runtime.CompilerServices;
23+
using System.Runtime.ExceptionServices;
2324
using System.Runtime.Loader;
25+
using System.Threading;
2426

2527
public static partial class DataContractSerializerTests
2628
{
@@ -4567,21 +4569,48 @@ public static void DCS_TypeWithPrimitiveKnownTypes()
45674569
// Random OSR might cause a stack overflow on Windows x64
45684570
private static bool IsNotWindowsRandomOSR => !PlatformDetection.IsWindows || (Environment.GetEnvironmentVariable("DOTNET_JitRandomOnStackReplacement") == null);
45694571

4572+
// DCS_DeeplyLinkedData runs the test body on a worker thread for stack-size control,
4573+
// so it requires multithreading support in addition to the OSR guard.
4574+
private static bool IsDeeplyLinkedDataSupported => IsNotWindowsRandomOSR && PlatformDetection.IsMultithreadingSupported;
4575+
45704576
[SkipOnPlatform(TestPlatforms.Browser, "Causes a stack overflow")]
4571-
[ActiveIssue("https://github.com/dotnet/runtime/issues/127463", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))]
4572-
[ConditionalFact(typeof(DataContractSerializerTests), nameof(IsNotWindowsRandomOSR))]
4577+
[ConditionalFact(typeof(DataContractSerializerTests), nameof(IsDeeplyLinkedDataSupported))]
45734578
public static void DCS_DeeplyLinkedData()
45744579
{
4575-
TypeWithLinkedProperty head = new TypeWithLinkedProperty();
4576-
TypeWithLinkedProperty cur = head;
4577-
for (int i = 0; i < 513; i++)
4580+
// The serializer recurses through dynamic-code paths roughly once per linked node.
4581+
// Default thread stacks on some platforms (notably Apple mobile) are not large enough
4582+
// for ~513 frames of dynamic-method-driven recursion, so run the body on a worker
4583+
// thread with an explicit 16 MB stack to keep the test platform-portable. 16 MB
4584+
// matches the maxStackSize used elsewhere in System.Threading.Thread tests.
4585+
const int StackSize = 16 * 1024 * 1024;
4586+
ExceptionDispatchInfo edi = null;
4587+
Thread t = new Thread(() =>
45784588
{
4579-
cur.Child = new TypeWithLinkedProperty();
4580-
cur = cur.Child;
4581-
}
4582-
cur.Children = new List<TypeWithLinkedProperty> { new TypeWithLinkedProperty() };
4583-
TypeWithLinkedProperty actual = DataContractSerializerHelper.SerializeAndDeserialize(head, baseline: null, skipStringCompare: true);
4584-
Assert.NotNull(actual);
4589+
try
4590+
{
4591+
TypeWithLinkedProperty head = new TypeWithLinkedProperty();
4592+
TypeWithLinkedProperty cur = head;
4593+
for (int i = 0; i < 513; i++)
4594+
{
4595+
cur.Child = new TypeWithLinkedProperty();
4596+
cur = cur.Child;
4597+
}
4598+
cur.Children = new List<TypeWithLinkedProperty> { new TypeWithLinkedProperty() };
4599+
TypeWithLinkedProperty actual = DataContractSerializerHelper.SerializeAndDeserialize(head, baseline: null, skipStringCompare: true);
4600+
Assert.NotNull(actual);
4601+
}
4602+
catch (Exception ex)
4603+
{
4604+
edi = ExceptionDispatchInfo.Capture(ex);
4605+
}
4606+
}, StackSize)
4607+
{
4608+
IsBackground = true,
4609+
};
4610+
t.Start();
4611+
// Bounded join so a runtime-side deadlock can't hang the entire Helix work item.
4612+
Assert.True(t.Join(TimeSpan.FromMinutes(2)), "DCS_DeeplyLinkedData worker thread did not complete within timeout.");
4613+
edi?.Throw();
45854614
}
45864615

45874616
[Fact]

src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/InvokeWithRefLikeArgs.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public static void MethodTakesRefStructAsArgWithDefaultValue_ThrowsNSE()
3737
// Moq heavily utilizes RefEmit, which does not work on most aot workloads
3838
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
3939
[SkipOnMono("https://github.com/dotnet/runtime/issues/40738")]
40-
[ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))]
4140
public static void MethodTakesRefToRefStructAsArg_ThrowsNSE()
4241
{
4342
// Use a Binder to trick the reflection stack into treating the returned null

src/libraries/tests.proj

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -659,17 +659,10 @@
659659
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Diagnostics.TraceSource\tests\System.Diagnostics.TraceSource.Config.Tests\System.Diagnostics.TraceSource.Config.Tests.csproj" />
660660
</ItemGroup>
661661

662-
<!-- https://github.com/dotnet/runtime/issues/124044 -->
662+
<!-- https://github.com/dotnet/runtime/issues/124344 -->
663663
<ItemGroup Condition="('$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'tvossimulator' or '$(TargetOS)' == 'maccatalyst') and '$(RuntimeFlavor)' == 'CoreCLR' and '$(UseNativeAOTRuntime)' != 'true'">
664-
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Diagnostics.Tracing\tests\System.Diagnostics.Tracing.Tests.csproj" />
665-
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Linq.Expressions\tests\System.Linq.Expressions.Tests.csproj" />
666664
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection.Emit\tests\System.Reflection.Emit.Tests.csproj" />
667665
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection.Emit.ILGeneration\tests\System.Reflection.Emit.ILGeneration.Tests.csproj" />
668-
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Reflection.Tests\InvokeEmit\System.Reflection.InvokeEmit.Tests.csproj" />
669-
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Reflection.Tests\InvokeInterpreted\System.Reflection.InvokeInterpreted.Tests.csproj" />
670-
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Reflection.Tests\System.Reflection.Tests.csproj" />
671-
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Memory\tests\System.Memory.Tests.csproj" />
672-
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Dynamic.Runtime.Tests\System.Dynamic.Runtime.Tests.csproj" />
673666
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Numerics.Tensors\tests\System.Numerics.Tensors.Tests.csproj" Condition="'$(TargetArchitecture)' == 'x64'" />
674667
</ItemGroup>
675668

0 commit comments

Comments
 (0)