Skip to content

[mobile] Disable NativeAOT-specific test failures on Apple mobile#130168

Merged
kotlarmilos merged 18 commits into
dotnet:mainfrom
kotlarmilos:mobile/disable-nativeaot-apple-mobile-tests
Jul 10, 2026
Merged

[mobile] Disable NativeAOT-specific test failures on Apple mobile#130168
kotlarmilos merged 18 commits into
dotnet:mainfrom
kotlarmilos:mobile/disable-nativeaot-apple-mobile-tests

Conversation

@kotlarmilos

@kotlarmilos kotlarmilos commented Jul 3, 2026

Copy link
Copy Markdown
Member

Description

This disables a set of tests that fail only under the NativeAOT runtime on Apple mobile platforms while continuing to pass on CoreCLR and Mono. The failures come from keychain entitlement handling in NativeAOT app bundles, reflection and configuration-from-file behavior in Microsoft.Extensions.Hosting, and an HttpListener closed-connection case.

Gate tests that fail only under the NativeAOT runtime on Apple mobile
platforms (iOS, tvOS, MacCatalyst). These pass on CoreCLR and Mono but
fail on NativeAOT due to keychain entitlement handling in AOT app
bundles (Pkcs), reflection/AOT differences (Microsoft.Extensions.Hosting
configuration-from-file and EventSourceLogger), and other NativeAOT-only
behavior. Conditioned on IsAppleMobile + IsNativeAot so coverage is
retained on CoreCLR/Mono and non-Apple platforms.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…-nativeaot-apple-mobile-tests

# Conflicts:
#	src/libraries/Microsoft.Extensions.Caching.Memory/tests/MemoryCacheSetAndRemoveTests.cs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 disables a set of library tests specifically for Apple mobile + NativeAOT by adding [ActiveIssue] gates to the affected test classes/methods, intending to keep coverage unchanged on CoreCLR/Mono and on non-Apple platforms.

Changes:

  • Add class-level [ActiveIssue] skips to multiple System.Security.Cryptography.Pkcs test classes when running on PlatformDetection.IsAppleMobile && PlatformDetection.IsNativeAot.
  • Add method-level [ActiveIssue] skips to failing tests in Microsoft.Extensions.Hosting, System.Net.HttpListener, System.Diagnostics.FileVersionInfo, and Microsoft.Extensions.Caching.Memory under the same Apple-mobile NativeAOT condition.
  • Centralize the suppression rationale via issue links in the new [ActiveIssue] attributes.
Show a summary per file
File Description
src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignerInfoTests.cs Adds class-level [ActiveIssue] for Apple mobile NativeAOT.
src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsTests.cs Adds class-level [ActiveIssue] for Apple mobile NativeAOT.
src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/CounterSigningDerOrder.cs Adds class-level [ActiveIssue] for Apple mobile NativeAOT.
src/libraries/System.Security.Cryptography.Pkcs/tests/Rfc3161/TimestampTokenTests.cs Adds class-level [ActiveIssue] for Apple mobile NativeAOT.
src/libraries/System.Security.Cryptography.Pkcs/tests/Rfc3161/TimestampRequestTests.cs Adds class-level [ActiveIssue] for Apple mobile NativeAOT.
src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/DecryptTestsUsingExplicitPrivateKey.cs Adds class-level [ActiveIssue] for Apple mobile NativeAOT.
src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/DecryptTestsUsingCertWithPrivateKey.cs Adds class-level [ActiveIssue] for Apple mobile NativeAOT.
src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/DecryptTestsRsaPaddingModeTests.cs Adds class-level [ActiveIssue] for Apple mobile NativeAOT.
src/libraries/System.Net.HttpListener/tests/HttpResponseStreamTests.cs Adds method-level [ActiveIssue] for Apple mobile NativeAOT closed-connection scenarios.
src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/FileVersionInfoTest.cs Adds method-level [ActiveIssue] for Apple mobile NativeAOT.
src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostTests.cs Adds method-level [ActiveIssue] for Apple mobile NativeAOT.
src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostBuilderTests.cs Adds method-level [ActiveIssue] for Apple mobile NativeAOT config-from-file scenario.
src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostApplicationBuilderTests.cs Adds method-level [ActiveIssue] for Apple mobile NativeAOT config-from-file scenario.
src/libraries/Microsoft.Extensions.Caching.Memory/tests/MemoryCacheSetAndRemoveTests.cs Adds method-level [ActiveIssue] for Apple mobile NativeAOT.

Copilot's findings

  • Files reviewed: 13/13 changed files
  • Comments generated: 14

Comment thread src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsTests.cs Outdated
Copilot AI review requested due to automatic review settings July 3, 2026 09:22
Use dotnet#126697 (test failures in .NET Apple mobile apps on
NativeAOT) instead of dotnet#127786, which is scoped to System.Runtime.Tests
single-file/static-link bundle failures and does not track these library
test failures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kotlarmilos

Copy link
Copy Markdown
Member Author

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 13/13 changed files
  • Comments generated: 2

Comment thread src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsTests.cs Outdated
Comment thread src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsTests.cs Outdated
Copilot AI review requested due to automatic review settings July 3, 2026 09:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 13/13 changed files
  • Comments generated: 2

The Apple mobile NativeAOT tracking issue (dotnet#126697) lists
FileVersionInfo_EmptyFVI as the failing FileVersionInfo test (it loads
Assembly1.cs via a relative path that is not bundled into the .app). The
gate was only applied to FileVersionInfo_CustomManagedAssembly, so add
the same NativeAOT ActiveIssue gate to FileVersionInfo_EmptyFVI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kotlarmilos

Copy link
Copy Markdown
Member Author

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

The System.Net.HttpListener.Tests project is fully excluded for Apple mobile
NativeAOT in tests.proj, so the per-test [ActiveIssue] annotations for the same
configuration were dead. Keep the project-level exclusion as the single mechanism.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 16/16 changed files
  • Comments generated: 2

Comment thread src/libraries/tests.proj
Copilot AI review requested due to automatic review settings July 9, 2026 08:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 16/16 changed files
  • Comments generated: 1

@kotlarmilos

Copy link
Copy Markdown
Member Author

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b83f3804-8c74-4dcb-a966-f80032c96f9a
Copilot AI review requested due to automatic review settings July 10, 2026 09:13
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b83f3804-8c74-4dcb-a966-f80032c96f9a
@kotlarmilos kotlarmilos enabled auto-merge (squash) July 10, 2026 09:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

Comments suppressed due to low confidence (1)

src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/FileVersionInfoTest.cs:27

  • WriteEmbeddedResourceToFile assumes GetManifestResourceStream(resourceName) succeeds. If the embedded resource name ever changes (e.g., LogicalName mismatch), this will fail with a NullReferenceException at source.CopyTo, which is hard to diagnose in CI. Consider throwing a clear exception when the resource stream is null.
        {
            string path = GetTestFilePath();
            using (Stream source = typeof(FileVersionInfoTest).Assembly.GetManifestResourceStream(resourceName))
            using (FileStream destination = File.Create(path))
            {
                source.CopyTo(destination);
            }

  • Files reviewed: 14/14 changed files
  • Comments generated: 0 new

Copilot AI review requested due to automatic review settings July 10, 2026 09:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

Comments suppressed due to low confidence (1)

src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/FileVersionInfoTest.cs:26

  • WriteEmbeddedResourceToFile will currently throw a NullReferenceException if the embedded resource name is wrong (GetManifestResourceStream returns null). Since this method is now used with multiple resource names (including "Assembly1.cs"), it’s worth failing with a clear exception message to make CI failures actionable.
        private string WriteEmbeddedResourceToFile(string resourceName)
        {
            string path = GetTestFilePath();
            using (Stream source = typeof(FileVersionInfoTest).Assembly.GetManifestResourceStream(resourceName))
            using (FileStream destination = File.Create(path))
            {
                source.CopyTo(destination);
            }
  • Files reviewed: 14/14 changed files
  • Comments generated: 0 new

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

Labels

area-Infrastructure linkable-framework Issues associated with delivering a linker friendly framework os-ios Apple iOS

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants