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
[tests] Use temporary directory in DocumentTest/FileCoordinatorTest and launch packaged macOS tests with spawner. Fixes #27138 - #27145
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>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Validation of native macOS TCC attribution and packaged spawner behavior remains pending on the affected Sonoma x64 and Sequoia arm64 CI workers.
No open issues 🎉
What changed in this PR
Addresses the file-deletion hang reported in #27138 by moving test files out of Documents and extending the existing spawner launch approach to packaged macOS tests.
Changes:
Use temporary directories and per-process filenames in document and file-coordination tests.
Build, package, and use spawner when launching packaged macOS tests.
Preserve argument boundaries in the timeout runner with ProcessStartInfo.ArgumentList.
… 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>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The launcher lacks an explicit macOS deployment target, risking startup failures on older bots, while permission changes break harness opt-in and unnecessarily require Bluetooth authorization for a synthetic test.
…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.
🔵 Needs a closer look
Explicitly disabling system permission tests leaves an inherited ENABLE_SYSTEM_PERMISSION_TESTS=1 intact, so the opt-out is ignored and permission dialogs can still block macOS and Mac Catalyst test runs.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Remove inherited permission-test enable variable when disabled
🤖 ⚠️Testing — If xharness inherits ENABLE_SYSTEM_PERMISSION_TESTS=1, selecting skip-system-permission-tests or --include-system-permission-tests=false only adds DISABLE_SYSTEM_PERMISSION_TESTS=1 here. The updated macOS/Mac Catalyst permission helper checks only the enable variable, so the explicit opt-out is ignored and permission dialogs can still block the run. Remove the inherited enable variable in the disabled branch.
Original PR #27145 was based on #24249, but release/10.0.1xx does not contain that prerequisite. Bring over the remaining functional pieces needed by this backport: avoid Documents-directory TCC prompts, launch direct and local desktop tests through spawner, and build spawner in the test pipeline.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep the nullable permission override independent from the selected test labels so simulator introspection keeps its platform default, while run-all still enables permission tests explicitly. Also clear the conflicting inherited permission variable before launching packaged macOS tests.
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
Native packaged validation on Sonoma x64 and Sequoia arm64 is still needed to confirm TCC attribution and absence of permission dialogs, with current CI checks pending.
Resolve the overlapping test isolation changes by keeping the newer release-branch implementations, which use unique per-test directories and updated backup-attribute validation.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…leCoordinatorTest 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.
- 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
🤖 Pull request created by Copilot
Backport of #27145.
---------
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…leCoordinatorTest and launch packaged macOS tests with spawner. Fixes#27138 (#27201)
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.
The release branch did not contain the `spawner` tool prerequisite, so
this backport also includes the tool and its normal build integration.
It preserves simulator permission-test defaults while disabling
TCC-prompting tests by default for unattended macOS and Mac Catalyst
runs.
Fixes#27138
Backport of #27145.
🤖 Pull request created by Copilot
---------
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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