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 {
272
272
public static func platformIsDarwin( _ message: String ) throws {
273
273
try XCTSkipUnless ( Platform . current == . darwin, message)
274
274
}
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
+ }
275
285
}
276
286
277
287
// MARK: - Parsing Swift compiler version
Original file line number Diff line number Diff line change @@ -55,8 +55,7 @@ final class TaskSchedulerTests: XCTestCase {
55
55
}
56
56
57
57
func testTasksWithElevatedPrioritiesGetExecutedFirst( ) async throws {
58
- try XCTSkipIf ( true , " rdar://128601797 " )
59
-
58
+ try SkipUnless . platformSupportsTaskPriorityElevation ( )
60
59
await runTaskScheduler (
61
60
scheduleTasks: { scheduler, taskExecutionRecorder in
62
61
for i in 0 ..< 20 {
You can’t perform that action at this time.
0 commit comments