Skip to content

Commit ba48467

Browse files
committed
Make extended js timeouts
1 parent 3c7c89c commit ba48467

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

gradle-conventions/src/main/kotlin/util/targets/js.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fun KmpConfig.configureJs() {
2222
nodejs {
2323
testTask {
2424
useMocha {
25-
timeout = "100s"
25+
timeout = "300s"
2626
}
2727
}
2828
}

krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTransportTestBase.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import kotlinx.serialization.encoding.Encoder
2828
import kotlinx.serialization.modules.SerializersModule
2929
import kotlin.coroutines.cancellation.CancellationException
3030
import kotlin.test.*
31+
import kotlin.time.Duration.Companion.seconds
3132

3233
internal object LocalDateSerializer : KSerializer<LocalDate> {
3334
override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("LocalDate", PrimitiveKind.STRING)
@@ -285,7 +286,7 @@ abstract class KrpcTransportTestBase {
285286
}
286287

287288
@Test
288-
fun `RPC should be able to receive 100_000 ints in reasonable time`() = runTest {
289+
fun `RPC should be able to receive 100_000 ints in reasonable time`() = runTest(timeout = JS_EXTENDED_TIMEOUT) {
289290
val n = 100_000
290291
assertEquals(client.getNInts(n).last(), n)
291292
}
@@ -437,4 +438,6 @@ abstract class KrpcTransportTestBase {
437438
}
438439
}
439440

441+
private val JS_EXTENDED_TIMEOUT = if (isJs) 300.seconds else 60.seconds
442+
440443
internal expect val isJs: Boolean

0 commit comments

Comments
 (0)