Skip to content

Commit cb24ce9

Browse files
committed
Skip testTasksWithElevatedPrioritiesGetExecutedFirst if the host OS doesn’t support task priority elevation
1 parent 83b8be8 commit cb24ce9

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Sources/SKTestSupport/SkipUnless.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,16 @@ public actor SkipUnless {
272272
public static func platformIsDarwin(_ message: String) throws {
273273
try XCTSkipUnless(Platform.current == .darwin, message)
274274
}
275+
276+
public static func platformSupportsTaskPriorityElevation() throws {
277+
#if os(macOS)
278+
guard #available(macOS 14.0, *) else {
279+
// Priority elevation was implemented by https://github.com/apple/swift/pull/63019, which is available in the
280+
// Swift 5.9 runtime included in macOS 14.0+
281+
throw XCTSkip("Priority elevation of tasks is only supported on macOS 14 and above")
282+
}
283+
#endif
284+
}
275285
}
276286

277287
// MARK: - Parsing Swift compiler version

Tests/SKCoreTests/TaskSchedulerTests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ final class TaskSchedulerTests: XCTestCase {
5555
}
5656

5757
func testTasksWithElevatedPrioritiesGetExecutedFirst() async throws {
58-
try XCTSkipIf(true, "rdar://128601797")
59-
58+
try SkipUnless.platformSupportsTaskPriorityElevation()
6059
await runTaskScheduler(
6160
scheduleTasks: { scheduler, taskExecutionRecorder in
6261
for i in 0..<20 {

0 commit comments

Comments
 (0)