 
   func assignIdentity<Act>(_ actorType: Act.Type) -> AnyActorIdentity
       where Act: DistributedActor {
-    let id = ActorAddress(parse: "xxx")
+    let id = ActorAddress(parse: "\(nextID)")
+    nextID += 1
     print("assign type:\(actorType), id:\(id)")
     return .init(id)
   }

// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime

// FIXME(distributed): we need to revisit what's going on on windows with distributed actors rdar://84574311
// UNSUPPORTED: OS=windows-msvc

// Disabled temporarily until we figure out why the test is flaky.
// REQUIRES: rdar84586299

import _Distributed


func test() async {
  let transport = FakeTransport()

  // NOTE: All allocated distributed actors should be saved in this array, so
  // that they will be deallocated together at the end of this test!
  // This convention helps ensure that the test is not flaky.
  var test: [DistributedActor?] = []

  test.append(LocalWorker(transport: transport))
  // CHECK: assign type:LocalWorker, id:ActorAddress(address: "[[ID1:.*]]")
  // CHECK: ready actor:main.LocalWorker, id:AnyActorIdentity(ActorAddress(address: "[[ID1]]"))

  test.append(PickATransport1(kappa: transport, other: 0))
  // CHECK: assign type:PickATransport1, id:ActorAddress(address: "[[ID2:.*]]")
  // CHECK: ready actor:main.PickATransport1, id:AnyActorIdentity(ActorAddress(address: "[[ID2]]"))

  test.append(try? Throwy(transport: transport, doThrow: false))
  // CHECK: assign type:Throwy, id:ActorAddress(address: "[[ID3:.*]]")
  // CHECK: ready actor:main.Throwy, id:AnyActorIdentity(ActorAddress(address: "[[ID3]]"))

  test.append(try? Throwy(transport: transport, doThrow: true))
  // CHECK: assign type:Throwy, id:ActorAddress(address: "[[ID4:.*]]")
  // CHECK-NOT: ready

  test.append(try? ThrowBeforeFullyInit(transport: transport, doThrow: true))
  // CHECK: assign type:ThrowBeforeFullyInit, id:ActorAddress(address: "[[ID5:.*]]")
  // CHECK-NOT: ready

  test.append(await PickATransport2(other: 1, theTransport: transport))
  // CHECK: assign type:PickATransport2, id:ActorAddress(address: "[[ID6:.*]]")
  // CHECK: ready actor:main.PickATransport2, id:AnyActorIdentity(ActorAddress(address: "[[ID6]]"))

  test.append(await Bug_CallsReadyTwice(transport: transport, wantBug: true))
    // CHECK: assign type:Bug_CallsReadyTwice, id:ActorAddress(address: "[[ID7:.*]]")
    // CHECK:      ready actor:main.Bug_CallsReadyTwice, id:AnyActorIdentity(ActorAddress(address: "[[ID7]]"))
    // CHECK-NEXT: ready actor:main.Bug_CallsReadyTwice, id:AnyActorIdentity(ActorAddress(address: "[[ID7]]"))

  // CHECK-DAG: resign id:AnyActorIdentity(ActorAddress(address: "[[ID1]]"))
  // CHECK-DAG: resign id:AnyActorIdentity(ActorAddress(address: "[[ID2]]"))
  // CHECK-DAG: resign id:AnyActorIdentity(ActorAddress(address: "[[ID3]]"))
  // MISSING-CHECK-DAG: resign id:AnyActorIdentity(ActorAddress(address: "[[ID4]]")) // FIXME: should eventually work (rdar://84533820).
  // MISSING-CHECK-DAG: resign id:AnyActorIdentity(ActorAddress(address: "[[ID5]]")) // FIXME: should eventually work (rdar://84533820).
  // CHECK-DAG: resign id:AnyActorIdentity(ActorAddress(address: "[[ID6]]"))
  // CHECK-DAG: resign id:AnyActorIdentity(ActorAddress(address: "[[ID7]]"))
}

@available(SwiftStdlib 5.5, *)
