You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/05/09 18:21:44 UTC

[GitHub] [kafka] jsancio opened a new pull request, #12141: MINOR; DeleteTopics version tests

jsancio opened a new pull request, #12141:
URL: https://github.com/apache/kafka/pull/12141

   Add a DeleteTopics test for all supported versions. Convert the
   DeleteTopicsRequestTest to run against both ZK and KRaft mode.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] dengziming commented on a diff in pull request #12141: MINOR; DeleteTopics version tests

Posted by GitBox <gi...@apache.org>.
dengziming commented on code in PR #12141:
URL: https://github.com/apache/kafka/pull/12141#discussion_r869904211


##########
core/src/test/scala/unit/kafka/server/DeleteTopicsRequestTest.scala:
##########
@@ -17,24 +17,28 @@
 
 package kafka.server
 
-import java.util.{Arrays, Collections}
-
+import java.util.Arrays
+import java.util.Collections
 import kafka.network.SocketServer
 import kafka.utils._
 import org.apache.kafka.common.Uuid
 import org.apache.kafka.common.message.DeleteTopicsRequestData
 import org.apache.kafka.common.message.DeleteTopicsRequestData.DeleteTopicState
 import org.apache.kafka.common.protocol.Errors
-import org.apache.kafka.common.requests.{DeleteTopicsRequest, DeleteTopicsResponse, MetadataRequest, MetadataResponse}
+import org.apache.kafka.common.requests.DeleteTopicsRequest
+import org.apache.kafka.common.requests.DeleteTopicsResponse
+import org.apache.kafka.common.requests.MetadataRequest
+import org.apache.kafka.common.requests.MetadataResponse
 import org.junit.jupiter.api.Assertions._
-import org.junit.jupiter.api.Test
-
+import org.junit.jupiter.params.ParameterizedTest
+import org.junit.jupiter.params.provider.ValueSource
 import scala.jdk.CollectionConverters._
 
-class DeleteTopicsRequestTest extends BaseRequestTest {
+class DeleteTopicsRequestTest extends BaseRequestTest with Logging {
 
-  @Test
-  def testValidDeleteTopicRequests(): Unit = {
+  @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
+  @ValueSource(strings = Array("zk", "kraft"))
+  def testValidDeleteTopicRequests(quorum: String): Unit = {

Review Comment:
   It seems this is flaky in KRaft mode, we have a `TestUtils.ensureConsistentKRaftMetadata` to fix this kind of flakiness, which waits until the brokers have caught up to the controller metadata topic end offset.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] jsancio commented on a diff in pull request #12141: MINOR; DeleteTopics version tests

Posted by GitBox <gi...@apache.org>.
jsancio commented on code in PR #12141:
URL: https://github.com/apache/kafka/pull/12141#discussion_r870749014


##########
core/src/test/scala/unit/kafka/server/DeleteTopicsRequestTest.scala:
##########
@@ -17,24 +17,28 @@
 
 package kafka.server
 
-import java.util.{Arrays, Collections}
-
+import java.util.Arrays
+import java.util.Collections
 import kafka.network.SocketServer
 import kafka.utils._
 import org.apache.kafka.common.Uuid
 import org.apache.kafka.common.message.DeleteTopicsRequestData
 import org.apache.kafka.common.message.DeleteTopicsRequestData.DeleteTopicState
 import org.apache.kafka.common.protocol.Errors
-import org.apache.kafka.common.requests.{DeleteTopicsRequest, DeleteTopicsResponse, MetadataRequest, MetadataResponse}
+import org.apache.kafka.common.requests.DeleteTopicsRequest
+import org.apache.kafka.common.requests.DeleteTopicsResponse
+import org.apache.kafka.common.requests.MetadataRequest
+import org.apache.kafka.common.requests.MetadataResponse
 import org.junit.jupiter.api.Assertions._
-import org.junit.jupiter.api.Test
-
+import org.junit.jupiter.params.ParameterizedTest
+import org.junit.jupiter.params.provider.ValueSource
 import scala.jdk.CollectionConverters._
 
-class DeleteTopicsRequestTest extends BaseRequestTest {
+class DeleteTopicsRequestTest extends BaseRequestTest with Logging {
 
-  @Test
-  def testValidDeleteTopicRequests(): Unit = {
+  @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
+  @ValueSource(strings = Array("zk", "kraft"))
+  def testValidDeleteTopicRequests(quorum: String): Unit = {

Review Comment:
   Thank @dengziming . I added the check. Let's see if the tests pass on Jenkins.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] jsancio merged pull request #12141: MINOR; DeleteTopics version tests

Posted by GitBox <gi...@apache.org>.
jsancio merged PR #12141:
URL: https://github.com/apache/kafka/pull/12141


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] dengziming commented on a diff in pull request #12141: MINOR; DeleteTopics version tests

Posted by GitBox <gi...@apache.org>.
dengziming commented on code in PR #12141:
URL: https://github.com/apache/kafka/pull/12141#discussion_r870885220


##########
core/src/test/scala/unit/kafka/server/DeleteTopicsRequestTest.scala:
##########
@@ -66,6 +70,11 @@ class DeleteTopicsRequestTest extends BaseRequestTest {
     val response = sendDeleteTopicsRequest(request)
     val error = response.errorCounts.asScala.find(_._1 != Errors.NONE)
     assertTrue(error.isEmpty, s"There should be no errors, found ${response.data.responses.asScala}")
+
+    if (isKRaftTest()) {

Review Comment:
   Tests all passed after this change.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] cmccabe commented on pull request #12141: MINOR; DeleteTopics version tests

Posted by GitBox <gi...@apache.org>.
cmccabe commented on PR #12141:
URL: https://github.com/apache/kafka/pull/12141#issuecomment-1121523918

   Looks like there is a scala warning (perhaps a difference in scala version behaviors?)
   ```
   [2022-05-09T18:40:33.800Z] [Error] /home/jenkins/workspace/Kafka_kafka-pr_PR-12141/core/src/test/scala/unit/kafka/server/DeleteTopicsRequestTest.scala:235:38: the result type of an implicit conversion must be more specific than Object
   ```


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org