Skip to content

Commit 489a64a

Browse files
committed
[Concurrency] harden async_task_cancellation_early test
1 parent 23fb398 commit 489a64a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/Concurrency/Runtime/async_task_cancellation_early.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,24 @@
44
// REQUIRES: concurrency
55
// REQUIRES: libdispatch
66

7-
// Temporarily disabled to unblock PR testing:
8-
// REQUIRES: rdar80745964
9-
107
// rdar://76038845
118
// UNSUPPORTED: use_os_stdlib
129
// UNSUPPORTED: back_deployment_runtime
1310

1411
import Dispatch
1512

13+
let seconds: UInt64 = 1_000_000_000
14+
1615
@available(SwiftStdlib 5.5, *)
1716
func test_detach_cancel_child_early() async {
1817
print(#function) // CHECK: test_detach_cancel_child_early
1918
let h: Task<Bool, Error> = Task.detached {
2019
async let childCancelled: Bool = { () -> Bool in
21-
await Task.sleep(2_000_000_000)
20+
do {
21+
try await Task.sleep(nanoseconds: 10 * seconds)
22+
} catch {
23+
print("sleep interrupted") // CHECK: sleep interrupted
24+
}
2225
return Task.isCancelled
2326
}()
2427

0 commit comments

Comments
 (0)