     print("exit detach")
   }
 
-  await Task.sleep(2 * 1_000_000)
+  await h.get()
 
   print("cancel")
   handle.cancel()


@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
func test() async {
  let handle = detach {
    print("detached run, cancelled:\(Task.isCancelled)")


    print("spawned: 1")
    async let two = printWaitPrint(2)
    print("spawned: 2")

    h.cancel()

    let first = await one
    print("awaited: 1: \(first)")
