From 15b166765b3810c793b8b1a387255bcb46ffc176 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Mon, 10 Apr 2017 15:51:03 +0200 Subject: [PATCH] Clarify awaitAssert scaladoc Make it more obvious that awaitAssert will periodically evaluate the assertion (including performing any side effects in it) until it succeeds (or the timeout is reached) --- akka-testkit/src/main/scala/akka/testkit/TestKit.scala | 5 ++--- .../src/main/scala/akka/testkit/javadsl/TestKit.scala | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/akka-testkit/src/main/scala/akka/testkit/TestKit.scala b/akka-testkit/src/main/scala/akka/testkit/TestKit.scala index d589cb1bed..946addd112 100644 --- a/akka-testkit/src/main/scala/akka/testkit/TestKit.scala +++ b/akka-testkit/src/main/scala/akka/testkit/TestKit.scala @@ -283,9 +283,8 @@ trait TestKitBase { } /** - * Await until the given assert does not throw an exception or the timeout - * expires, whichever comes first. If the timeout expires the last exception - * is thrown. + * Evaluate the given assert every `interval` until it does not throw an exception. + * If the `max` timeout expires the last exception is thrown. * * If no timeout is given, take it from the innermost enclosing `within` * block. diff --git a/akka-testkit/src/main/scala/akka/testkit/javadsl/TestKit.scala b/akka-testkit/src/main/scala/akka/testkit/javadsl/TestKit.scala index 217a9a5438..92d39cd9d2 100644 --- a/akka-testkit/src/main/scala/akka/testkit/javadsl/TestKit.scala +++ b/akka-testkit/src/main/scala/akka/testkit/javadsl/TestKit.scala @@ -195,9 +195,8 @@ class TestKit(system: ActorSystem) { def awaitAssert(max: Duration, a: Supplier[Any]): Unit = tp.awaitAssert(a.get, max) /** - * Await until the given assert does not throw an exception or the timeout - * expires, whichever comes first. If the timeout expires the last exception - * is thrown. + * Evaluate the given assert every `interval` until it does not throw an exception. + * If the `max` timeout expires the last exception is thrown. * * Note that the timeout is scaled using Duration.dilated, * which uses the configuration entry "akka.test.timefactor".