You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[release/11.0.1xx] [tests] Use temporary directory in DocumentTest/FileCoordinatorTest and launch packaged macOS tests with spawner. Fixes #27138 - #27200
On the Sonoma (mac_14_x64) and Sequoia (mac_15_arm64) CI bots, DocumentTest.PerformAsynchronousFileAccess_Null hung for 600s in File.Delete ('/Users/builder/Documents/mydocument.txt'):
DocumentTest.GetFileName () (and FileCoordinatorTest.GetUrl ()) used Environment.SpecialFolder.MyDocuments, which resolves to ~/Documents on Mac Catalyst.
Packaged macOS test runs did not launch test apps via tools/spawner/spawner, so tccd attributed TCC checks to the Azure DevOps agent's node binary. After an agent update on the bots, the new node binary path lacked Full Disk Access and did not match the com.apple.macl xattr on the leftover ~/Documents/mydocument.txt file created before the update, causing sandboxd/tccd to block unlink() on a modal kTCCServiceSystemPolicyDocumentsFolder prompt.
Switch DocumentTest and FileCoordinatorTest to use NSFileManager.TemporaryDirectory with per-process file names, and package and use tools/spawner/spawner when executing packaged macOS tests.
…nd launch packaged macOS tests with spawner. Fixes#27138
On the Sonoma (mac_14_x64) and Sequoia (mac_15_arm64) CI bots, DocumentTest.PerformAsynchronousFileAccess_Null hung for 600s in File.Delete ('/Users/builder/Documents/mydocument.txt'):
- DocumentTest.GetFileName () (and FileCoordinatorTest.GetUrl ()) used Environment.SpecialFolder.MyDocuments, which resolves to ~/Documents on Mac Catalyst.
- Packaged macOS test runs did not launch test apps via tools/spawner/spawner, so tccd attributed TCC checks to the Azure DevOps agent's node binary. After an agent update on the bots, the new node binary path lacked Full Disk Access and did not match the com.apple.macl xattr on the leftover ~/Documents/mydocument.txt file created before the update, causing sandboxd/tccd to block unlink() on a modal kTCCServiceSystemPolicyDocumentsFolder prompt.
- Even with spawner, test apps do not have TCC grants for ~/Documents (which is why FileManagerTest, UrlTest, and AudioConverterTest were moved off NSSearchPathDirectory.DocumentDirectory in #24249).
Switch DocumentTest and FileCoordinatorTest to use NSFileManager.TemporaryDirectory with per-process file names, and package and use tools/spawner/spawner when executing packaged macOS tests.
Fixes#27138
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… in monotouch-test.
When monotouch-test is launched via 'spawner' on macOS and Mac Catalyst, the test app is evaluated on its own TCC identity rather than inheriting permissions from the parent process. Unlike iOS/tvOS simulators, the system TCC database cannot be pre-populated, so any test that triggers a TCC prompt (Contacts, Bluetooth, Microphone) can block or pop up modal dialogs:
- Default TestRuntime.IgnoreTestThatRequiresSystemPermissions () to true on macOS and Mac Catalyst (unless ENABLE_SYSTEM_PERMISSION_TESTS is set).
- Remove unnecessary TestRuntime.RequestContactsPermission () calls from ContactFetchRequestTest and ContactVCardSerializationTest (neither test accesses CNContactStore, and calling RequestAccess hung macOS/Mac Catalyst x64 on Sonoma in CI).
- Check Bluetooth permission in RegistrarTest.EventTestOSType before creating CBCentralManager.
- Ignore microphone-dependent tests on macOS in TestRuntime.RequestMicrophonePermission () (just like Mac Catalyst), add missing RequestMicrophonePermission () calls to AVAudioSinkNodeTest, AVAudioSourceNodeTest, AudioToolbox.AudioUnitTest.Callbacks, AVAudioIONodeTests, AudioUnitTests.GetCurrentDevice_Test, and AUGraphTests.DoTest, and use GenericOutput instead of VoiceProcessingIO in AUAudioUnitFactoryTest and AudioUnitTest.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…and address review feedback.
- Call TestRuntime.CheckContactsPermission () in ContactFetchRequestTest and ContactVCardSerializationTest: CNContactVCardSerialization.GetDescriptorFromRequiredKeys () reads ~/Library/Preferences/com.apple.AddressBook.plist, which triggers sandboxd to request kTCCServiceAddressBook approval (preflight=no) on macOS 14 Sonoma and blocks when permission is NotDetermined.
- Set -mmacosx-version-min=$(DOTNET_MIN_MACOS_SDK_VERSION) in tools/spawner/Makefile so the packaged spawner binary targets the minimum supported macOS version.
- Pass ENABLE_SYSTEM_PERMISSION_TESTS=1 in MacExecuteTask when Harness.GetIncludeSystemPermissionTests returns true, and only override Harness.IncludeSystemPermissionTests in TestSelector when an explicit system-permission label is provided.
- Use TestRuntime.CheckBluetoothPermission () (assert_granted: false) in RegistrarTest.EventTestOSType.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The change skips the iOS/tvOS introspection suites entirely and fails to clear inherited permission-test enable flags on explicit opt-out, allowing blocking macOS permission dialogs.
This backport addresses macOS and Mac Catalyst test hangs associated with privacy prompts, including the document-file deletion hang reported in #27138.
Changes:
Move document and file-coordination tests to temporary, per-process paths.
Package and use spawner for macOS test execution, and preserve argument boundaries in the timeout launcher.
Make macOS permission-sensitive tests opt-in and update affected test guards.
Keep simulator introspection selected when permission tests use their platform defaults, while still honoring explicit run-all and system-permission labels. Also remove inherited permission environment flags that conflict with the selected setting.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The default permission fallback fails to distinguish iOS simulators from devices, causing permission-sensitive tests with undetermined authorization to be skipped in CI.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Fix iOS simulator permission tests being skipped in CI
tests/xharness/Jenkins/TestSelector.cs:225
🤖 ⚠️Testing — With the permission override now unset by default, simulator launches receive DISABLE_SYSTEM_PERMISSION_TESTS=1: AppRunner.cs:237 passes TestPlatform.iOS, whose fallback in Harness.cs:316–322 returns !InCI without checking device. Permission-sensitive tests with undetermined authorization are therefore skipped in CI, even though the introspection projects remain selected. Remove iOS from the macOS fallback group so it uses the existing device/simulator distinction in the default branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On the Sonoma (
mac_14_x64) and Sequoia (mac_15_arm64) CI bots,DocumentTest.PerformAsynchronousFileAccess_Nullhung for 600s inFile.Delete ('/Users/builder/Documents/mydocument.txt'):DocumentTest.GetFileName ()(andFileCoordinatorTest.GetUrl ()) usedEnvironment.SpecialFolder.MyDocuments, which resolves to~/Documentson Mac Catalyst.tools/spawner/spawner, sotccdattributed TCC checks to the Azure DevOps agent'snodebinary. After an agent update on the bots, the newnodebinary path lacked Full Disk Access and did not match thecom.apple.maclxattr on the leftover~/Documents/mydocument.txtfile created before the update, causingsandboxd/tccdto blockunlink()on a modalkTCCServiceSystemPolicyDocumentsFolderprompt.spawner, test apps do not have TCC grants for~/Documents(which is whyFileManagerTest,UrlTest, andAudioConverterTestwere moved offNSSearchPathDirectory.DocumentDirectoryin [tools] Add a tool to launch processes disclaming responsibility. #24249).Switch
DocumentTestandFileCoordinatorTestto useNSFileManager.TemporaryDirectorywith per-process file names, and package and usetools/spawner/spawnerwhen executing packaged macOS tests.Fixes #27138
🤖 Pull request created by Copilot
Backport of #27145.