From 547fb6f4a9e360b05168f4cefdc74e1033c664ae Mon Sep 17 00:00:00 2001 From: Anton Keks Date: Fri, 24 May 2024 10:03:33 +0300 Subject: [PATCH] make test more stable --- sample/test/klite/jdbc/JdbcExtensionsTest.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sample/test/klite/jdbc/JdbcExtensionsTest.kt b/sample/test/klite/jdbc/JdbcExtensionsTest.kt index 4eaf77c9..35f11e11 100644 --- a/sample/test/klite/jdbc/JdbcExtensionsTest.kt +++ b/sample/test/klite/jdbc/JdbcExtensionsTest.kt @@ -8,7 +8,6 @@ import klite.sample.TempTableDBTest import klite.toValues import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.Channel.Factory.UNLIMITED -import kotlinx.coroutines.delay import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Test import java.math.BigDecimal @@ -95,9 +94,11 @@ open class JdbcExtensionsTest: TempTableDBTest() { @Test fun `postgres notify and listen`() = runTest { val channel = Channel(UNLIMITED) val reader = thread { - db.consumeNotifications(setOf("hello"), 100.milliseconds) { channel.trySend(it.parameter) } + db.consumeNotifications(setOf("hello"), 500.milliseconds) { + channel.trySend(it.parameter) + } } - delay(100) + Thread.sleep(100) db.notify("hello") db.notify("hello", "world") Transaction.current()!!.commit()