From bb1d14966c8e10ae61289b93c9e86c2e95ad0572 Mon Sep 17 00:00:00 2001 From: Jan Cizmar Date: Thu, 14 Dec 2023 20:19:49 +0100 Subject: [PATCH] fix: Update test assertions and exception handling --- .../kotlin/io/tolgee/StreamingBodyDatabasePoolHealthTest.kt | 2 +- .../controllers/v2KeyController/KeyControllerKeySearchTest.kt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/app/src/test/kotlin/io/tolgee/StreamingBodyDatabasePoolHealthTest.kt b/backend/app/src/test/kotlin/io/tolgee/StreamingBodyDatabasePoolHealthTest.kt index c983e760bb..20be335d24 100644 --- a/backend/app/src/test/kotlin/io/tolgee/StreamingBodyDatabasePoolHealthTest.kt +++ b/backend/app/src/test/kotlin/io/tolgee/StreamingBodyDatabasePoolHealthTest.kt @@ -56,7 +56,7 @@ class StreamingBodyDatabasePoolHealthTest : ProjectAuthControllerTest("/v2/proje fun `streaming responses do not cause a database connection pool exhaustion`() { retry( retries = 10, - exceptionMatcher = { getRootCause(it) is ConcurrentModificationException } + exceptionMatcher = { getRootCause(it) is ConcurrentModificationException || it is IllegalStateException } ) { val hikariDataSource = dataSource as HikariDataSource val pool = hikariDataSource.hikariPoolMXBean diff --git a/backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/v2KeyController/KeyControllerKeySearchTest.kt b/backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/v2KeyController/KeyControllerKeySearchTest.kt index 8fca80134d..5a961a6f6a 100644 --- a/backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/v2KeyController/KeyControllerKeySearchTest.kt +++ b/backend/app/src/test/kotlin/io/tolgee/api/v2/controllers/v2KeyController/KeyControllerKeySearchTest.kt @@ -86,7 +86,6 @@ class KeyControllerKeySearchTest : ProjectAuthControllerTest("/v2/projects/"), L executeInNewTransaction { val time = measureTimeMillis { performProjectAuthGet("keys/search?search=dol&languageTag=de").andAssertThatJson { - node("page.totalElements").isNumber.isGreaterThan(2000.toBigDecimal()) node("page.totalElements").isNumber.isGreaterThan(4000.toBigDecimal()) }.andPrettyPrint }