peterxcli commented on code in PR #18175:
URL: https://github.com/apache/kafka/pull/18175#discussion_r1900441105
##########
core/src/test/scala/integration/kafka/api/ProducerRebootstrapTest.scala:
##########
@@ -18,15 +18,14 @@ package kafka.api
import org.apache.kafka.clients.producer.ProducerRecord
import org.junit.jupiter.api.Assertions.assertEquals
-import org.junit.jupiter.api.Disabled
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.ValueSource
class ProducerRebootstrapTest extends RebootstrapTest {
- @Disabled("KAFKA-17986")
@ParameterizedTest(name =
"{displayName}.quorum=kraft.useRebootstrapTriggerMs={0}")
@ValueSource(booleans = Array(false, true))
def testRebootstrap(useRebootstrapTriggerMs: Boolean): Unit = {
+ // It's ok to shut the leader down, cause the reelection is small enough
to the producer timeout.
Review Comment:
helper function I added to test above stuff.
```scala
def createTopicWithAssignmentAndConfig(
topic: String,
partitionReplicaAssignment: collection.Map[Int, Seq[Int]],
topicConfig: Properties = new Properties,
listenerName: ListenerName = listenerName,
adminClientConfig: Properties = new Properties
): scala.collection.immutable.Map[Int, Int] = {
if (isKRaftTest()) {
Using.resource(createAdminClient(brokers, listenerName,
adminClientConfig)) { admin =>
TestUtils.createTopicWithAdmin(
admin = admin,
topic = topic,
brokers = brokers,
controllers = controllerServers,
replicaAssignment = partitionReplicaAssignment,
topicConfig = topicConfig
)
}
} else {
TestUtils.createTopic(
zkClient = zkClient,
topic = topic,
partitionReplicaAssignment = partitionReplicaAssignment,
servers = servers,
topicConfig = topicConfig
)
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]