Skip to content

Skip Start_Disposed_ThrowsObjectDisposedException on Apple mobile platforms#126655

Merged
kotlarmilos merged 1 commit intomainfrom
fix/process-test-skip-mobile-platforms
Apr 9, 2026
Merged

Skip Start_Disposed_ThrowsObjectDisposedException on Apple mobile platforms#126655
kotlarmilos merged 1 commit intomainfrom
fix/process-test-skip-mobile-platforms

Conversation

@steveisok
Copy link
Copy Markdown
Member

Fix

Adds [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] to Start_Disposed_ThrowsObjectDisposedException.

Why

Process.Start() on iOS/tvOS/MacCatalyst throws PlatformNotSupportedException (process launching is unsupported) before checking disposal state. The test expects ObjectDisposedException which never fires, causing a deterministic failure across 7 legs in every runtime-extra-platforms rolling build.

This follows the same [SkipOnPlatform] pattern used by 20+ other tests in the same file.

Fixes #126654

…tforms

Process.Start() on iOS/tvOS/MacCatalyst throws PlatformNotSupportedException
(unsupported platform) before checking disposal state, so the test's
ObjectDisposedException assertion never fires.

Fixes #126654

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-diagnostics-process
See info in area-owners.md if you want to be subscribed.

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

Skips ProcessTests.Start_Disposed_ThrowsObjectDisposedException on Apple mobile platforms where Process.Start() is unsupported and deterministically throws PlatformNotSupportedException before disposal checks, causing consistent test failures in runtime-extra-platforms.

Changes:

  • Added [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, ...)] to Start_Disposed_ThrowsObjectDisposedException.

@steveisok
Copy link
Copy Markdown
Member Author

@kotlarmilos should this not apply to maccatalyst?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

🤖 Copilot Code Review — PR #126655

Note

This review was generated by GitHub Copilot.

Holistic Assessment

Motivation: The problem is real and verified — Process.Start() throws PlatformNotSupportedException on iOS/tvOS before checking disposal state (line 1167–1169 in Process.cs), so the test's ObjectDisposedException assertion never fires. Skipping on those platforms is the correct fix.

Approach: Adding [SkipOnPlatform] follows the established pattern used by 20+ tests in the same file. This is the right approach for a test that exercises behavior impossible on unsupported platforms.

Summary: ⚠️ Needs Human Review. The iOS/tvOS skip is correct, but MacCatalyst should likely be removed from the skip list. The author has already raised this question in the PR comments. A human reviewer should confirm.


Detailed Findings

⚠️ MacCatalyst may be incorrectly included in the skip

ProcessUtils.PlatformSupportsProcessStartAndKill (ProcessUtils.cs:15–16) is:

=> !((OperatingSystem.IsIOS() && !OperatingSystem.IsMacCatalyst()) || OperatingSystem.IsTvOS());

On MacCatalyst, IsIOS() = true and IsMacCatalyst() = true, so:

  • (true && !true) || falsefalse
  • !falsetrue — MacCatalyst is supported

This is consistent with the [SupportedOSPlatform("maccatalyst")] attribute on Process.Start() (line 1159). On MacCatalyst the code reaches CheckDisposed() (line 1173) and would correctly throw ObjectDisposedException — meaning the test should pass there.

The skip attribute should likely be:

[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "Process.Start() is not supported on iOS and tvOS.")]

Note: The author has already flagged this question in the PR comments ("should this not apply to maccatalyst?"). The issue description's mention of MacCatalyst failures may stem from other tests or a different root cause — worth verifying with CI data.

✅ iOS and tvOS skip is correct

Verified via code analysis: Process.Start()PlatformSupportsProcessStartAndKill returns false on iOS (non-MacCatalyst) and tvOS → PlatformNotSupportedException thrown at line 1169, before CheckDisposed() at line 1173. The test cannot pass on these platforms.

✅ Other disposal tests are unaffected

The sibling tests (StandardInput_Disposed, StandardOutput_Disposed, StandardError_Disposed, CancelOutputRead_Disposed, CancelErrorRead_Disposed) all call CheckDisposed() as their first operation with no platform guard before it, so they correctly throw ObjectDisposedException on all platforms, including iOS/tvOS. Only Start_Disposed needs this skip.

✅ Pattern consistency

The attribute follows the same [SkipOnPlatform(...)] pattern used throughout the file. The skip reason message is clear and accurate.

Generated by Code Review for issue #126655 ·

@vitek-karas
Copy link
Copy Markdown
Member

#126631 does the same... not a problem necessarily.

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.

ProcessTests.Start_Disposed_ThrowsObjectDisposedException fails on iOS/tvOS/MacCatalyst

5 participants