Skip to content

Commit 92ba280

Browse files
committed
refactor: increase the timeout for publish/consume kafka tests
1 parent 1e0ae0b commit 92ba280

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

starters/spring/tests/spring-test-fixtures/src/testFixtures/kotlin/com/trendyol/stove/testing/e2e/kafka/StringSerdeKafkaSystemTests.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import io.kotest.core.spec.style.ShouldSpec
77
import io.kotest.matchers.shouldBe
88
import org.apache.kafka.clients.admin.NewTopic
99
import kotlin.random.Random
10+
import kotlin.time.Duration.Companion.seconds
1011

1112
/**
1213
* Shared Kafka string serde tests that work across all Spring Boot versions.
@@ -78,14 +79,13 @@ abstract class StringSerdeKafkaSystemTests(
7879
validate {
7980
kafka {
8081
val userId = Random.nextInt().toString()
81-
val message =
82-
"this message is coming from ${testCase.descriptor.id.value} and testName is ${testCase.name.name}"
82+
val message = "this message is coming from ${testCase.descriptor.id.value} and testName is ${testCase.name.name}"
8383
val headers = mapOf("x-user-id" to userId)
8484
publish("topic", message, serde = StoveSerde.jackson.anyJsonStringSerde().some(), headers = headers)
85-
shouldBePublished<String> {
85+
shouldBePublished<String>(atLeastIn = 20.seconds) {
8686
actual == message && this.metadata.headers["x-user-id"] == userId && this.metadata.topic == "topic"
8787
}
88-
shouldBeConsumed<String> {
88+
shouldBeConsumed<String>(atLeastIn = 20.seconds) {
8989
actual == message && this.metadata.headers["x-user-id"] == userId && this.metadata.topic == "topic"
9090
}
9191
}

0 commit comments

Comments
 (0)