- Timeout timeout = new Timeout(100, TimeUnit.MILLISECONDS);
- Future<ActorRef> future = system.actorSelection(actorRef.path()).resolveOne(timeout);
- Await.ready(future, timeout.duration());
- break;
- } catch (Exception e) {
- if(tries++ > 20) {
- throw new RuntimeException(e);
- }
+ ActorSelection actorSelection = system.actorSelection(actorRef.path().toString());
+ Future<Object> future = Patterns.ask(actorSelection, new Identify(""), timeout);
+ ActorIdentity reply = (ActorIdentity)Await.result(future, timeout.duration());
+ Assert.assertNotNull("Identify returned null", reply.getRef());
+ return;
+ } catch (Exception | AssertionError e) {
+ Uninterruptibles.sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
+ lastError = e;