Account for potential delay inaccuracy in test

Sleep for slightly longer duration since the thread can be waked
a bit earlier than the specified amount of time.
This commit is contained in:
Ilya Gorbunov
2022-07-15 18:24:46 +02:00
committed by teamcity
parent 4e31f368d5
commit e5902e736d
@@ -14,7 +14,7 @@ class TimeMarkJVMTest {
@Test
fun longDurationElapsed() {
TimeMarkTest().testLongDisplacement(TimeSource.Monotonic, { waitDuration -> Thread.sleep(waitDuration.inWholeMilliseconds) })
TimeMarkTest().testLongDisplacement(TimeSource.Monotonic, { waitDuration -> Thread.sleep((waitDuration * 1.1).inWholeMilliseconds) })
}
@Test