File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments