From e8232664f3366118f10bbd94cbe49faeeb41445d Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 7 Aug 2024 16:30:43 +0600 Subject: [PATCH] update delay on creating tests in cache --- .../commonTest/kotlin/full/FullKeyValueCacheRepoTests.kt | 6 +++--- .../commonTest/kotlin/full/FullKeyValuesCacheRepoTests.kt | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/repos/cache/src/commonTest/kotlin/full/FullKeyValueCacheRepoTests.kt b/repos/cache/src/commonTest/kotlin/full/FullKeyValueCacheRepoTests.kt index d4008bce742..ee11087c3e9 100644 --- a/repos/cache/src/commonTest/kotlin/full/FullKeyValueCacheRepoTests.kt +++ b/repos/cache/src/commonTest/kotlin/full/FullKeyValueCacheRepoTests.kt @@ -3,6 +3,7 @@ package full import com.benasher44.uuid.uuid4 import dev.inmo.micro_utils.repos.* import dev.inmo.micro_utils.repos.cache.full.FullKeyValueCacheRepo +import korlibs.time.seconds import kotlinx.coroutines.test.runTest import kotlin.test.Test import kotlin.test.assertEquals @@ -11,7 +12,7 @@ import kotlin.test.assertTrue class FullKeyValueCacheRepoTests { @Test - fun creatingWorksProperly() = runTest { + fun creatingWorksProperly() = runTest(timeout = 120.seconds) { val testData = (0 until 1000).associate { ("$it-" + uuid4().toString()) to "$it-" + uuid4().toString() } @@ -23,8 +24,7 @@ class FullKeyValueCacheRepoTests { val cacheRepo = FullKeyValueCacheRepo( kvRepo, - kvCache, - skipStartInvalidate = true + kvCache ) testData.forEach { diff --git a/repos/cache/src/commonTest/kotlin/full/FullKeyValuesCacheRepoTests.kt b/repos/cache/src/commonTest/kotlin/full/FullKeyValuesCacheRepoTests.kt index 9fe58d6327a..33545abf474 100644 --- a/repos/cache/src/commonTest/kotlin/full/FullKeyValuesCacheRepoTests.kt +++ b/repos/cache/src/commonTest/kotlin/full/FullKeyValuesCacheRepoTests.kt @@ -5,13 +5,14 @@ import dev.inmo.micro_utils.repos.* import dev.inmo.micro_utils.repos.cache.full.FullKeyValuesCacheRepo import dev.inmo.micro_utils.repos.pagination.maxPagePagination import korlibs.time.days +import korlibs.time.seconds import korlibs.time.years import kotlinx.coroutines.test.runTest import kotlin.test.* class FullKeyValuesCacheRepoTests { @Test - fun creatingWorksProperly() = runTest { + fun creatingWorksProperly() = runTest(timeout = 120.seconds) { val testData = (0 until 1000).associate { ("$it-" + uuid4().toString()) to (0 until 1000).map { "$it-" + uuid4().toString()