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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user