=tes #3727 Fix timing failure in TestTimeSpec
This commit is contained in:
parent
6ab4733fa7
commit
8e74bbdc8b
1 changed files with 4 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue