From 8e74bbdc8b14aa07cbd271629521076df9b6d63d Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Wed, 11 Dec 2013 15:58:54 +0100 Subject: [PATCH] =tes #3727 Fix timing failure in TestTimeSpec --- akka-testkit/src/test/scala/akka/testkit/TestTimeSpec.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/akka-testkit/src/test/scala/akka/testkit/TestTimeSpec.scala b/akka-testkit/src/test/scala/akka/testkit/TestTimeSpec.scala index e12cd51e34..e7642c1c29 100644 --- a/akka-testkit/src/test/scala/akka/testkit/TestTimeSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/TestTimeSpec.scala @@ -12,13 +12,15 @@ class TestTimeSpec extends AkkaSpec(Map("akka.test.timefactor" -> 2.0)) with Bef "A TestKit" must { "correctly dilate times" taggedAs TimingTest in { + 1.second.dilated.toNanos must be(1000000000L * testKitSettings.TestTimeFactor) + val probe = TestProbe() val now = System.nanoTime intercept[AssertionError] { probe.awaitCond(false, Duration("1 second")) } val diff = System.nanoTime - now val target = (1000000000l * testKitSettings.TestTimeFactor).toLong - diff must be > (target - 300000000l) - diff must be < (target + 300000000l) + diff must be > (target - 500000000l) + diff must be < (target + 500000000l) } "awaitAssert must throw correctly" in {