From b169f356434696532dc82ea43c2289153b40f9dd Mon Sep 17 00:00:00 2001 From: Roland Kuhn Date: Sun, 27 Mar 2011 18:15:40 +0200 Subject: [PATCH] fix error handling in TestKit.within restore outer deadline in case the code block does throw an exception. This is done in order to reduce the number of follow-on test failures. --- akka-testkit/src/main/scala/akka/testkit/TestKit.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/akka-testkit/src/main/scala/akka/testkit/TestKit.scala b/akka-testkit/src/main/scala/akka/testkit/TestKit.scala index a2d26ac4a8..5ce90509ba 100644 --- a/akka-testkit/src/main/scala/akka/testkit/TestKit.scala +++ b/akka-testkit/src/main/scala/akka/testkit/TestKit.scala @@ -157,7 +157,7 @@ trait TestKit { val prev_end = end end = start + max_diff - val ret = f + val ret = try f finally end = prev_end val diff = now - start assert (min <= diff, "block took "+format(min.unit, diff)+", should at least have been "+min) @@ -170,7 +170,6 @@ trait TestKit { lastSoftTimeout -= 5.millis } - end = prev_end ret }