Skip to content

[tvOS] Skip symlink and named pipe tests that fail on iOS/tvOS#125503

Open
Copilot wants to merge 3 commits intomainfrom
copilot/fix-unauthorized-access-symlink
Open

[tvOS] Skip symlink and named pipe tests that fail on iOS/tvOS#125503
Copilot wants to merge 3 commits intomainfrom
copilot/fix-unauthorized-access-symlink

Conversation

Copy link
Contributor

Copilot AI commented Mar 12, 2026

tvOS (and iOS) raise UnauthorizedAccessException when creating symbolic links and return errors for mkfifo, causing GetFileType_SymbolicLink and GetFileType_NamedPipe to fail consistently on tvOS/arm64 CI legs.

Changes

  • GetFileType_SymbolicLink: Replace [Fact] with [ConditionalFact(typeof(MountHelper), nameof(MountHelper.CanCreateSymbolicLinks))] — skips on any platform where symlink creation is not permitted (tvOS, unprivileged environments)
  • GetFileType_NamedPipe: Add [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] — consistent with the identical skip applied to NamedPipe_ReadWrite in DevicesPipesAndSockets.cs

Description

SafeFileHandle_GetFileType_Unix.GetFileType_SymbolicLink and GetFileType_NamedPipe were unconditionally running on all Unix platforms. tvOS prohibits symbolic link creation (EPERM) and does not support mkfifo, causing both tests to fail on every tvOS CI run across both CoreCLR and Mono legs.

Customer Impact

No customer impact; this is a test-only fix to stop recurring false CI failures on tvOS.

Regression

No — these tests never passed on tvOS. The failures surfaced as the tvOS leg became more active in CI.

Testing

The fixes mirror already-established skip patterns for the same platforms elsewhere in the same test assembly. No new logic is introduced in product code.

Risk

Minimal. Test-only change, no product code modified. The MountHelper.CanCreateSymbolicLinks guard is already widely used across the symbolic link test suite; SkipOnPlatform for iOS/tvOS is an established pattern in the same file's sibling tests.

Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.

Original prompt

This section details on the original issue you should resolve

<issue_title>UnauthorizedAccessException creating symlink on tvOS device (Operation not permitted)</issue_title>
<issue_description>Suggested labels: Known Build Error, test-failure, os-tvos, arch-arm64, untriaged

Note: This issue was automatically generated by AI-Test-Triage. Please review and triage accordingly.

Build Information

Build: 20260309.1, 20260310.2

Build error leg or test failing: System.IO.Tests.SafeFileHandle_GetFileType_Unix.GetFileType_SymbolicLink, System.IO.Tests.SafeFileHandle_GetFileType_Unix.GetFileType_NamedPipe, System.IO.FileSystem.Tests.WorkItemExecution

Affected CI jobs: build_tvos_arm64_Release_AllSubsets_CoreCLR, build_tvOS_arm64_Release_AllSubsets_Mono

Causing Commit Range Information

Commit range: {TODO: Insert commit range or link to changes}

Summary

  • UnauthorizedAccessException ('Operation not permitted') occurs when creating symbolic links during System.IO tests.
  • Failures reproducible on tvOS device runs in build_tvos_arm64_Release_AllSubsets_CoreCLR (tvos/arm64).
  • Tests are executed via XHarness/mlaunch; test harness reports XHarness exit code 1 (TESTS_FAILED).
  • Device interaction logs sometimes show mlaunch exiting with code 137, concurrent with the symlink failures.
  • Root failure surfaces in System.IO.File.CreateSymbolicLink invoked from SafeFileHandle_GetFileType_Unix.GetFileType_SymbolicLink.

Failure Statistics

Note: These statistics are based on the configured time range and might not reflect the full history of the failure.

  • Occurrence Count: 12
  • First Failure: 2026-03-10 07:35:08 UTC
  • Last Failure: 2026-03-11 08:06:52 UTC

Work Items

Showing 10 most recent of 12 occurrences

Work Item Console Log Build Job Name
System.IO.FileSystem.Tests Work Item
View Extract
[00:57:32.8313560] 	2026-03-09 21:57:32.892 System.IO.FileSystem.Tests[13824:11381713] 	[FAIL] System.IO.Tests.SafeFileHandle_GetFileType_Unix.GetFileType_SymbolicLink
[00:57:32.8331760] 2026-03-09 21:57:32.893 System.IO.FileSystem.Tests[13824:11381713] System.UnauthorizedAccessException : Access to the path '/private/var/mobile/Containers/Data/Application/B4A6FCC5-9050-463B-8950-5CABC94B81D8/tmp/#SafeFileHandle_GetFileType_Unix_w1d2lkuk.cut/GetFileType_SymbolicLink_48_4n3u3cep' is denied.
[00:57:32.8332330] ---- System.IO.IOException : Operation not permitted
[00:57:32.8332590] at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
[00:57:32.8332710] 2026-03-09 21:57:32.893 System.IO.FileSystem.Tests[13824:11381713] at Interop.CheckIo(Int64 result, String path, Boolean isDirError)
[00:57:32.8332810] at System.IO.File.CreateSymbolicLink(String path, String pathToTarget)
...
[00:58:52] dbug: Saving diagnostics data to '/tmp/helix/working/AF5009A4/w/B0360953/e/diagnostics.json'
XHarness exit code: 1 (TESTS_FAILED)
...
[00:58:35] dbug: Process mlaunch exited with 137
[00:58:35] dbug: Test run completed
Full Log
20260309.1 build_tvos_arm64_Release_AllSubsets_CoreCLR
System.IO.Tests.SafeFileHandle_GetFileType_Unix.GetFileType_SymbolicLink
View Extract
[01:14:52.1100100]  Test collection for System.IO.Tests.SafeFileHandle_GetFileType_Unix
[01:14:52.1303710] 2026-03-09 22:14:52.261 System.IO.FileSystem.Tests[15414:12129812] [FAIL] System.IO.Tests.SafeFileHandle_GetFileType_Unix.GetFileType_SymbolicLink
[01:14:52.1303870] 2026-03-09 22:14:52.262 System.IO.FileSystem.Tests[15414:12129812] System.UnauthorizedAccessException : Access to the path '/private/var/mobile/Containers/Data/Application/E898CCCE-58BD-4C37-972C-D1B8DB22D2FC/tmp/#SafeFileHandle_GetFileType_Unix_5ihimqbm.qpy/GetFileType_SymbolicLink_48_9mv0gog9' is denied.
[01:14:52.1303920] ---- System.IO.IOException : Operation not permitted
[01:14:52.1303970] at System.IO.File.CreateSymbolicLink(String path, String pathToTarget)
[01:14:52.1317430] 2026-03-09 22:14:52.262 System.IO.FileSystem.Tests[15414:12129812] at System.IO.Tests.SafeFileHandle_GetFileType_Unix.GetFileType_SymbolicLink()
[01:14:52.1317860] at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
[01:14:52.1317930] at Syst...

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@dotnet-policy-service
Copy link
Contributor

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

- GetFileType_SymbolicLink: replace [Fact] with [ConditionalFact(typeof(MountHelper), nameof(MountHelper.CanCreateSymbolicLinks))] to skip when symlinks cannot be created (e.g., tvOS)
- GetFileType_NamedPipe: add [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, ...)] since iOS/tvOS blocks binding to UNIX sockets

Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix UnauthorizedAccessException creating symlink on tvOS device [tvOS] Skip symlink and named pipe tests that fail on iOS/tvOS Mar 12, 2026
Copilot AI requested a review from adamsitnik March 12, 2026 16:52
@adamsitnik adamsitnik marked this pull request as ready for review March 12, 2026 17:08
Copilot AI review requested due to automatic review settings March 12, 2026 17:08
@adamsitnik
Copy link
Member

/azp list

@azure-pipelines

This comment was marked as resolved.

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

Adjusts Unix GetFileType tests to avoid consistent failures on iOS/tvOS where symlinks and FIFOs aren’t permitted/supported, reducing false CI failures on tvOS/arm64.

Changes:

  • Skip GetFileType_NamedPipe on iOS/tvOS.
  • Gate GetFileType_SymbolicLink behind MountHelper.CanCreateSymbolicLinks.

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

…SafeFileHandle/GetFileType.Unix.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@adamsitnik
Copy link
Member

For some reason all CI legs are cancelled, I am going to close and re-open the PR..

@adamsitnik adamsitnik closed this Mar 12, 2026
@adamsitnik adamsitnik reopened this Mar 12, 2026
Copy link
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 assuming the tests are going to pass.

To other reviewers: I've checked how other symlink/mkfifo tests are annotated and just asked Copilot to apply these annotations for me.

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.

UnauthorizedAccessException creating symlink on tvOS device (Operation not permitted)

3 participants