Refactor test to be more lenient in timing

This commit is contained in:
Michael Kaye 2022-06-09 21:39:43 +01:00
parent 8fb6957bc0
commit 38126c6b4f

View File

@ -24,14 +24,14 @@ class TemporaryStoreTest {
@Test
fun testTemporaryStore() {
// Keep the data 30 millis
val store = TemporaryStore<String>(30)
// Keep the data 300 millis
val store = TemporaryStore<String>(300)
store.data = "test"
store.data shouldBe "test"
sleep(15)
sleep(10)
store.data shouldBe "test"
sleep(20)
sleep(300)
store.data shouldBe null
}
}