Skip to content

[ios-clr] Remove ActiveIssue attribute for CoreCLR library tests on Apple mobile#125439

Draft
kotlarmilos wants to merge 7 commits intodotnet:mainfrom
kotlarmilos:improvement/ios-clr-library-tests
Draft

[ios-clr] Remove ActiveIssue attribute for CoreCLR library tests on Apple mobile#125439
kotlarmilos wants to merge 7 commits intodotnet:mainfrom
kotlarmilos:improvement/ios-clr-library-tests

Conversation

@kotlarmilos
Copy link
Member

@kotlarmilos kotlarmilos commented Mar 11, 2026

Description

This PR tries to fix the failing CoreCLR tests on Apple mobile.

Copilot AI review requested due to automatic review settings March 11, 2026 12:56
@kotlarmilos kotlarmilos self-assigned this Mar 11, 2026
@kotlarmilos kotlarmilos added this to the 11.0.0 milestone Mar 11, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to address failing test runs on Apple mobile (iOS/tvOS) when using CoreCLR by re-enabling previously skipped coverage and adjusting test/build configuration so those tests can execute successfully.

Changes:

  • Removed Apple mobile/CoreCLR ActiveIssue skips across several library tests and removed some Apple mobile project exclusions.
  • Updated CustomAttributeDecoderTests to derive the expected System.Type assembly-qualified string from metadata (more resilient to trimming/ILLink differences).
  • Adjusted test build targets to allow preview features/runtime-async on Apple mobile targets.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/libraries/tests.proj Removes Apple mobile/CoreCLR exclusions for specific test projects so they run again.
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/InvokeWithRefLikeArgs.cs Re-enables a previously skipped Apple mobile/CoreCLR test (still guarded by Reflection.Emit support).
src/libraries/System.Runtime/tests/System.Globalization.Calendars.Tests/CalendarTestWithConfigSwitch/CalendarTests.cs Re-enables a previously skipped Apple mobile/CoreCLR calendar parsing test.
src/libraries/System.Runtime.Loader/tests/RefEmitLoadContext/RefEmitLoadContextTest.cs Re-enables a previously skipped Apple mobile/CoreCLR Reflection.Emit load-context test.
src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/CustomAttributes/DllImportTests.cs Reorders ActiveIssue attributes (no behavioral code change).
src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/CustomAttributeDecoderTests.cs Makes expected System.Type string match decoder output post-trimming and avoids using Type.GetType for enum underlying types.
src/libraries/System.Collections/tests/BitArray/BitArray_CtorTests.cs Re-enables a previously skipped Apple mobile/CoreCLR BitArray clone test.
eng/testing/tests.targets Enables preview features/runtime-async for Apple mobile targets by removing an exclusion.
Comments suppressed due to low confidence (2)

src/libraries/System.Runtime/tests/System.Globalization.Calendars.Tests/CalendarTestWithConfigSwitch/CalendarTests.cs:25

  • The test comment says the legacy behavior "On mobile, this does not throw", but after removing the Apple mobile skip this test will run on Apple mobile and still asserts a FormatException. Either update the comment to the specific platform(s) where it doesn’t throw (e.g., Android-only), or extend the skip/condition so the assertion matches actual mobile behavior.
        [Fact]
        [SkipOnPlatform(TestPlatforms.Android, "Doesn't throw on mobile")]
        public static void TestJapaneseCalendarDateParsing()
        {
            CultureInfo ciJapanese = new CultureInfo("ja-JP") { DateTimeFormat = { Calendar = new JapaneseCalendar() } };

            DateTime dt = new DateTime(1970, 1, 1);
            string eraName = dt.ToString("gg", ciJapanese);

            // Legacy behavior which we used to throw when using a year number exceeding the era max year.
            //
            // On mobile, this does not throw, but instead produces a DateTime w/ 95/01/01
            Assert.ThrowsAny<FormatException>(() => DateTime.Parse(eraName + " 70/1/1 0:00:00", ciJapanese));
        }

src/libraries/System.Collections/tests/BitArray/BitArray_CtorTests.cs:280

  • Re-enabling this test on Apple mobile means it will allocate a BitArray of length int.MaxValue-30 (~256MB+), which is likely to OOM or heavily destabilize test runs on memory-constrained devices. Consider reducing the allocation size while still covering the clone path, or gating this test (e.g., OuterLoop / platform-conditional) for constrained environments.
        [Fact]
        public static void Clone_LongLength_Works()
        {
            BitArray bitArray = new BitArray(int.MaxValue - 30);
            BitArray clone = (BitArray)bitArray.Clone();

            Assert.Equal(bitArray.Length, clone.Length);
        }

You can also share your feedback on Copilot code review. Take the survey.

Copilot AI review requested due to automatic review settings March 13, 2026 07:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.


You can also share your feedback on Copilot code review. Take the survey.

@kotlarmilos
Copy link
Member Author

/azp run runtime-ioslike

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kotlarmilos kotlarmilos changed the title [ios-clr] Remove ActiveIssue references for Apple Mobile in various tests and update project exclusions [ios-clr] Remove ActiveIssue references for CoreCLR library tests on Apple mobile Mar 16, 2026
@kotlarmilos kotlarmilos changed the title [ios-clr] Remove ActiveIssue references for CoreCLR library tests on Apple mobile [ios-clr] Remove ActiveIssue attribute for CoreCLR library tests on Apple mobile Mar 16, 2026
@kotlarmilos
Copy link
Member Author

azp run runtime-ioslike,runtime-ioslikesimulator,runtime-maccatalyst

@kotlarmilos
Copy link
Member Author

/azp run runtime-ioslike,runtime-ioslikesimulator,runtime-maccatalyst

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

… stubs

Fix two root causes of CoreCLR crashes on iOS/tvOS:

1. TransitionBlock.FromTarget() used TargetOS.OSX to select
   AppleArm64TransitionBlock, which only matched macOS. iOS/tvOS
   used the standard Arm64TransitionBlock with 8-byte stack alignment
   instead of Apple's natural alignment, producing incorrect GC ref
   maps that mismatched the runtime.
   Fix: Use target.IsApplePlatform which covers all Apple platforms.

2. AsyncResumptionStub generates synthetic IL with tokens referencing
   ParameterizedType/InstantiatedType. These tokens must be wrapped
   in manifest module tokens via ManifestModuleWrappedMethodIL. The
   CoreLib was in the version bubble (Apple mobile tests), wrapping
   was skipped and token resolution threw NotImplementedException.
   Fix: Wrap AsyncResumptionStub tokens unconditionally.

Fixes dotnet#124325, dotnet#125724, dotnet#125725, dotnet#125726

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings March 18, 2026 16:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.


You can also share your feedback on Copilot code review. Take the survey.

@kotlarmilos
Copy link
Member Author

/azp run runtime-ioslike,runtime-ioslikesimulator,runtime-maccatalyst

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings March 20, 2026 09:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated no new comments.

@kotlarmilos
Copy link
Member Author

/azp run runtime-ioslikesimulator,runtime-maccatalyst

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

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

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants