Skip to content

Commit b33c671

Browse files
committed
Extended timeouts
1 parent 8523fb3 commit b33c671

File tree

7 files changed

+21
-19
lines changed

7 files changed

+21
-19
lines changed

krpc/krpc-core/src/commonTest/kotlin/kotlinx/rpc/krpc/KrpcConnectorTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ abstract class KrpcConnectorBaseTest {
326326
)
327327

328328
protected fun runTest(
329-
testTimeout: Duration = 3.seconds,
329+
testTimeout: Duration = 15.seconds,
330330
waitTimeout: Duration = 1.seconds,
331331
callTimeout: Duration = 1.seconds,
332332
perCallBufferSize: Int = 100,

krpc/krpc-core/src/commonTest/kotlin/kotlinx/rpc/krpc/KrpcReceiveHandlerTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ internal class KrpcReceiveHandlerTest : KrpcReceiveHandlerBaseTest() {
114114
callTimeOut = 10.seconds,
115115
bufferSize = bufferSize,
116116
callHandler = { collected.add(it) },
117-
timeout = 120.seconds,
117+
timeout = 240.seconds,
118118
) { acting ->
119119
val sendChannel = Channel<KrpcTransportMessage>(Channel.UNLIMITED)
120120
val sender = KrpcSendHandler(sendChannel)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,6 @@ abstract class KrpcTransportTestBase {
498498
}
499499
}
500500

501-
private val JS_EXTENDED_TIMEOUT = if (isJs) 300.seconds else 60.seconds
501+
private val JS_EXTENDED_TIMEOUT = if (isJs) 400.seconds else 120.seconds
502502

503503
internal expect val isJs: Boolean

krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/TransportTest.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import kotlin.test.Test
2525
import kotlin.test.assertEquals
2626
import kotlin.test.assertFails
2727
import kotlin.test.assertTrue
28+
import kotlin.time.Duration
2829
import kotlin.time.Duration.Companion.seconds
2930

3031
@Rpc
@@ -81,9 +82,10 @@ class TransportTest {
8182
}
8283

8384
private fun runTest(
85+
timeout: Duration = 120.seconds,
8486
times: Int = testIterations,
8587
block: suspend TestScope.(logs: List<String>) -> Unit,
86-
): TestResult = kotlinx.coroutines.test.runTest(timeout = 120.seconds) {
88+
): TestResult = kotlinx.coroutines.test.runTest(timeout = timeout) {
8789
debugCoroutines()
8890

8991
repeat(times) {
@@ -205,7 +207,7 @@ class TransportTest {
205207
}
206208

207209
@Test
208-
fun testLateConnectWithManyCallsAndClients() = runTest {
210+
fun testLateConnectWithManyCallsAndClients() = runTest(timeout = 240.seconds) {
209211
val transports = LocalTransport()
210212

211213
val client = clientOf(transports)

krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationToolkit.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import kotlinx.rpc.withService
2424
import kotlin.time.Duration.Companion.seconds
2525

2626
fun runCancellationTest(body: suspend CancellationToolkit.() -> Unit): TestResult {
27-
return runTest(timeout = 3.seconds) {
27+
return runTest(timeout = 15.seconds) {
2828
debugCoroutines()
2929
val toolkit = CancellationToolkit(this)
3030
try {

krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/krpc/test/stress/StressTest.kt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,54 +18,54 @@ import kotlin.time.Duration.Companion.seconds
1818
class StressTest : BaseStressTest() {
1919
// ~30 sec, 300_000 messages
2020
@Test
21-
fun `unary, buffer 100, launches 3_000 x 100`() = testUnary(100, 120.seconds, 3_000, 100)
21+
fun `unary, buffer 100, launches 3_000 x 100`() = testUnary(100, 240.seconds, 3_000, 100)
2222

2323
// ~10 sec, 100_000 messages
2424
@Test
25-
fun `unary, buffer 1, launches 10_000 x 10`() = testUnary(1, 120.seconds, 10_000, 10)
25+
fun `unary, buffer 1, launches 10_000 x 10`() = testUnary(1, 240.seconds, 10_000, 10)
2626

2727
// ~51 min, 500_000 messages
2828
@Test
29-
fun `unary, 1000 buffer, launches 50_000 x 10`() = testUnary(1000, 180.seconds, 50_000, 10)
29+
fun `unary, 1000 buffer, launches 50_000 x 10`() = testUnary(1000, 360.seconds, 50_000, 10)
3030

3131

3232
// ~15 sec, 4_000_000 messages
3333
@Test
34-
fun `server streaming, buffer 30 buf, launches 200 x 10`() = testServerStreaming(30, 120.seconds, 200, 10)
34+
fun `server streaming, buffer 30 buf, launches 200 x 10`() = testServerStreaming(30, 240.seconds, 200, 10)
3535

3636
// ~19 sec, 4_000_000 messages
3737
@Test
38-
fun `server streaming, buffer 1, launches 200 x 10`() = testServerStreaming(1, 120.seconds, 200, 10)
38+
fun `server streaming, buffer 1, launches 200 x 10`() = testServerStreaming(1, 240.seconds, 200, 10)
3939

4040
// ~14 sec, 4_000_000 messages
4141
@Test
42-
fun `server streaming, buffer 2000, launches 200 x 10`() = testServerStreaming(2000, 180.seconds, 200, 10)
42+
fun `server streaming, buffer 2000, launches 200 x 10`() = testServerStreaming(2000, 360.seconds, 200, 10)
4343

4444

4545
// ~15 sec, 4_000_000 messages
4646
@Test
47-
fun `client streaming, buffer 30, launches 200 x 10`() = testClientStreaming(30, 120.seconds, 200, 10)
47+
fun `client streaming, buffer 30, launches 200 x 10`() = testClientStreaming(30, 240.seconds, 200, 10)
4848

4949
// ~19 sec, 4_000_000 messages
5050
@Test
51-
fun `client streaming, buffer 1, launches 200 x 10`() = testClientStreaming(1, 120.seconds, 200, 10)
51+
fun `client streaming, buffer 1, launches 200 x 10`() = testClientStreaming(1, 240.seconds, 200, 10)
5252

5353
// ~15 sec, 4_000_000 messages
5454
@Test
55-
fun `client streaming, buffer 2000, launches 200 x 10`() = testClientStreaming(2000, 180.seconds, 200, 10)
55+
fun `client streaming, buffer 2000, launches 200 x 10`() = testClientStreaming(2000, 360.seconds, 200, 10)
5656

5757

5858
// ~30 sec, 4_500_000 messages
5959
@Test
60-
fun `bidi streaming, buffer 30, launches 150 x 10`() = testBidiStreaming(30, 120.seconds, 150, 10)
60+
fun `bidi streaming, buffer 30, launches 150 x 10`() = testBidiStreaming(30, 240.seconds, 150, 10)
6161

6262
// ~33 sec, 4_500_000 messages
6363
@Test
64-
fun `bidi streaming, buffer 1, launches 150 x 10`() = testBidiStreaming(1, 120.seconds, 150, 10)
64+
fun `bidi streaming, buffer 1, launches 150 x 10`() = testBidiStreaming(1, 240.seconds, 150, 10)
6565

6666
// ~29 sec, 4_500_000 messages
6767
@Test
68-
fun `bidi streaming, buffer 2000, launches 150 x 10`() = testBidiStreaming(2000, 120.seconds, 150, 10)
68+
fun `bidi streaming, buffer 2000, launches 150 x 10`() = testBidiStreaming(2000, 240.seconds, 150, 10)
6969
}
7070

7171

tests/krpc-protocol-compatibility-tests/src/test/kotlin/kotlinx/rpc/krpc/test/compat/KrpcProtocolCompatibilityTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class KrpcProtocolCompatibilityTests : KrpcProtocolCompatibilityTestsBase() {
138138
}
139139

140140
@TestFactory
141-
fun fastProducer() = matrixTest(timeout = 30.seconds) { service, impl ->
141+
fun fastProducer() = matrixTest(timeout = 60.seconds) { service, impl ->
142142
val async = async {
143143
service.fastServerProduce(1000).map {
144144
// long produce

0 commit comments

Comments
 (0)