Commit ccc70fb
[tests] Avoid writing to the Documents directory in FileManagerTest.GetSkipBackupAttribute.
Across every one of the 12 monotouch-test macOS configurations in CI
run 15213209 (PR #24249), the test suite hung 100% reproducibly right
after NSFileManagerTest.GetHomeDirectoryTest, which is exactly where
GetSkipBackupAttribute runs next (alphabetically). lldb backtraces of
the hung process show the main thread stuck in a getxattr syscall,
which is how macOS's sandbox/TCC subsystem checks extended attributes
(e.g. com.apple.macl) when a process is granted or denied access to a
protected user folder.
GetSkipBackupAttribute writes a scratch file into the user's Documents
directory (NSSearchPathDirectory.DocumentDirectory), which is one of
the folders macOS protects behind a 'Files and Folders' TCC prompt.
Now that tests are launched through the new spawner tool (which
disclaims process responsibility so the test app is evaluated on its
own TCC status instead of inheriting an already-approved ancestor's),
the ephemeral test app has no existing grant for this folder, so the
write triggers a fresh authorization prompt that hangs forever with no
interactive session available to answer it, exactly matching the
observed CI hangs.
Use NSFileManager.TemporaryDirectory instead, which isn't behind a TCC
prompt (and is already the established convention for scratch files
elsewhere in this test suite, e.g. AudioConverterTest.cs and
FSEventStreamTest.cs). The test only needs a writable file to exercise
GetSkipBackupAttribute/SetSkipBackupAttribute, not specifically a file
in the Documents directory.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent e09f46f commit ccc70fb
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
0 commit comments