File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -55,8 +55,6 @@ import Dispatch
5555 static func testSleepCancelledBeforeStarted( ) async {
5656 // CHECK-NEXT: Testing sleep that gets cancelled before it starts
5757 print ( " Testing sleep that gets cancelled before it starts " )
58- let start = DispatchTime . now ( )
59-
6058 let sleepyTask = Task {
6159 try await Task . sleep ( nanoseconds: UInt64 ( pause) )
6260 }
@@ -65,20 +63,14 @@ import Dispatch
6563 sleepyTask. cancel ( )
6664 try await sleepyTask. value
6765
68- fatalError ( " sleep(nanoseconds:) should have thrown CancellationError " )
66+ print ( " Bah, weird scheduling " )
6967 } catch is CancellationError {
70- // CHECK-NEXT: Caught the cancellation error
7168 print ( " Caught the cancellation error " )
72-
73- let stop = DispatchTime . now ( )
74-
75- // assert that we stopped early.
76- assert ( stop < ( start + . nanoseconds( pause) ) )
7769 } catch {
7870 fatalError ( " sleep(nanoseconds:) threw some other error: \( error) " )
7971 }
8072
81- // CHECK-NEXT : Cancelled!
73+ // CHECK: Cancelled!
8274 print ( " Cancelled! " )
8375 }
8476
You can’t perform that action at this time.
0 commit comments