File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 4
4
// REQUIRES: concurrency
5
5
// REQUIRES: libdispatch
6
6
7
- // Temporarily disabled to unblock PR testing:
8
- // REQUIRES: rdar80745964
9
-
10
7
// rdar://76038845
11
8
// UNSUPPORTED: use_os_stdlib
12
9
// UNSUPPORTED: back_deployment_runtime
13
10
14
11
import Dispatch
15
12
13
+ let seconds : UInt64 = 1_000_000_000
14
+
16
15
@available ( SwiftStdlib 5 . 5 , * )
17
16
func test_detach_cancel_child_early( ) async {
18
17
print ( #function) // CHECK: test_detach_cancel_child_early
19
18
let h : Task < Bool , Error > = Task . detached {
20
19
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
+ }
22
25
return Task . isCancelled
23
26
} ( )
24
27
You can’t perform that action at this time.
0 commit comments