Skip to content

[mobile] Add MacCatalyst to Console OpenStandardHandle test exclusions#127274

Open
github-actions[bot] wants to merge 2 commits intomainfrom
mobile-fix-console-maccatalyst-2f64009d55531485
Open

[mobile] Add MacCatalyst to Console OpenStandardHandle test exclusions#127274
github-actions[bot] wants to merge 2 commits intomainfrom
mobile-fix-console-maccatalyst-2f64009d55531485

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Fixes System.Console.Tests failures on MacCatalyst discovered in runtime-extra-platforms build #1388505.

Failure

Build: #1388505 (2026-04-21)
Job: maccatalyst-arm64 Release AllSubsets_Mono
Helix job: f4caa84e-1526-4c12-a872-6f24ac6f3ba1
Work item: System.Console.Tests
Platform: MacCatalyst arm64 (also affects maccatalyst-x64)

Failed tests

Four tests failed with PlatformNotSupportedException:

  1. OpenStandardInputHandle_ReturnsValidHandle
  2. OpenStandardOutputHandle_ReturnsValidHandle
  3. OpenStandardErrorHandle_ReturnsValidHandle
  4. OpenStandardHandles_DoNotOwnHandle
[FAIL] System.Tests.ConsoleTests.OpenStandardInputHandle_ReturnsValidHandle
System.PlatformNotSupportedException : Operation is not supported on this platform.
   at System.ConsolePal.OpenStandardInputHandle()
   at System.Console.OpenStandardInputHandle()

Root cause

The Console.OpenStandardXXXHandle() methods throw PlatformNotSupportedException on mobile platforms (iOS, tvOS, Android, MacCatalyst) because these platforms do not expose the underlying file handles for standard streams.

The existing tests already had [PlatformSpecific] attributes excluding iOS, tvOS, and Android, but MacCatalyst was missing from the exclusion list. This is an oversight because MacCatalyst has the same limitation as other Apple mobile platforms.

Fix

Add TestPlatforms.MacCatalyst to the exclusion list (using & ~TestPlatforms.MacCatalyst) on all five tests that attempt to use these APIs, and add it to the inclusion list on the three "ThrowsOnUnsupportedPlatforms" tests that validate the exception is thrown.

This makes the skip coverage consistent across all mobile platforms:

  • Skip on: iOS, tvOS, MacCatalyst, Android, Browser (where applicable)
  • Run on: Windows, Linux, macOS desktop

Testing

After this fix, the four failing tests will be skipped on MacCatalyst in the runtime-extra-platforms pipeline, matching the behavior on iOS, tvOS, and Android.


Note

This PR was created by GitHub Copilot after analyzing mobile platform CI failures in the runtime-extra-platforms pipeline (build 1388505).

Note

🔒 Integrity filter blocked 1 item

The following item were blocked because they don't meet the GitHub integrity level.

  • #126805 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".

To allow these resources, lower min-integrity in your GitHub frontmatter:

tools:
  github:
    min-integrity: approved  # merged | approved | unapproved | none

Generated by Mobile Platform Failure Scanner · ● 2.2M ·

Fixes System.Console.Tests failures on MacCatalyst discovered in build #1388505.

The tests for Console.OpenStandardInputHandle(), OpenStandardOutputHandle(),
and OpenStandardErrorHandle() were already excluding iOS, tvOS, and Android
(where these APIs throw PlatformNotSupportedException), but were missing
MacCatalyst from the exclusion list.

This caused 4 test failures on maccatalyst-arm64:
- OpenStandardInputHandle_ReturnsValidHandle
- OpenStandardOutputHandle_ReturnsValidHandle
- OpenStandardErrorHandle_ReturnsValidHandle
- OpenStandardHandles_DoNotOwnHandle

The fix adds TestPlatforms.MacCatalyst to the exclusion list on all affected
tests, and adds it to the inclusion list on the corresponding "ThrowsOnUnsupportedPlatforms" tests.

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1388505
Job: maccatalyst-arm64 Release AllSubsets_Mono
Work item: System.Console.Tests
Helix job: f4caa84e-1526-4c12-a872-6f24ac6f3ba1

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-console
See info in area-owners.md if you want to be subscribed.

@kotlarmilos kotlarmilos marked this pull request as ready for review April 22, 2026 11:32
@kotlarmilos kotlarmilos added this to the 11.0.0 milestone Apr 22, 2026
Copy link
Copy Markdown
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 fixes System.Console.Tests failures on MacCatalyst by aligning the PlatformSpecific test filters with other mobile platforms where Console.OpenStandard*Handle() is not supported.

Changes:

  • Exclude TestPlatforms.MacCatalyst from tests that expect standard handles to be available/usable.
  • Include TestPlatforms.MacCatalyst in tests that validate PlatformNotSupportedException is thrown on unsupported platforms.

Copy link
Copy Markdown
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

LGTM, we need to update the code review skill to require the tests to be annotated when testing APIs that are not available on every platform

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants