KAFKA-14595 ReassignPartitionsIntegrationTest rewritten in java#14456
KAFKA-14595 ReassignPartitionsIntegrationTest rewritten in java#14456jolshan merged 15 commits intoapache:trunkfrom
Conversation
|
Hello @tledkov can you, please, take a look? |
tledkov
left a comment
There was a problem hiding this comment.
The patch is OK with me.
New java-test looks similar to the removed scala-test.
It would be nice to draw the community's attention to the fact that the functionality of ClusterTestExtensions is insufficient. The @BeforeEach cannot use with a started cluster. And there is not similar fucntionality. In this test, for example, this is the reason for copying the call of the method createTopics in each test.
|
|
||
| private Admin adminClient; | ||
|
|
||
| @ClusterTemplate("zkAndKRaft") |
There was a problem hiding this comment.
Can we keep with the @ParameterizedTest format we use for other tests? I think it is good to keep things consistent.
There was a problem hiding this comment.
Also let me know if this was decided for the Java migrations and I missed that. 😅
There was a problem hiding this comment.
Hello, @jolshan
For now, I know the following ways to setup integration test
- Use scala
QuorumTestHarness- see existingReassignPartitionsIntegrationTest.scala. - Use java annotation
@ClusterTestDefaults- seeDeleteRecordsCommandTest. - Use
@ClusterTemplate- like I did inReassignPartitionsIntegrationTest.javafor now.
I don't know what is the correct way to implement test.
AFAICU you suggesting to use QuorumTestHarness with ParametrizedTest annotation.
Is this correct?
I had such version of ReassignPartitionsIntegrationTest.java but replace it with the current version. So it's will be easy to revert to earlier version :)
There was a problem hiding this comment.
I was suggesting the QuorumTestHarness approach, but I wasn't sure if there was a unified/preferred way to do the conversions. Unless there are any issues with the QuorumTestHarness approach or there are benefits with the ClusterTemplate one, I think it makes sense to stick with it.
There was a problem hiding this comment.
I reverted new ReassignPartitionsIntegrationTest to use QuorumTestHarness so now it's structure is very similary to the scala version. Please, take a look.
|
|
||
| @SuppressWarnings({"deprecation", "unchecked"}) | ||
| private static <T> scala.collection.mutable.Set<T> mutableSet(final T...set) { | ||
| return JavaConverters.asScalaSet(new HashSet<>(Arrays.asList(set))); |
There was a problem hiding this comment.
I thought we had some non-deprecated methods to do this in the code. Is this no longer the case?
There was a problem hiding this comment.
Is this no longer the case?
I spend some time to find one during implementation of #14355 , actually.
All methods I found either don't exists in scala 2.12 or deprecated in scala 2.13.
Do you know the way to convert collections scala <-> java that will work both in scala 2.12 and scala 2.13 and will not be deprecated in scala 2.13?
Anyway, these methods will be removed in #13247 .
There was a problem hiding this comment.
Hmm. I think I saw some examples of scala.collection.JavaConverters that didn't have deprecation warnings on them. I did a search of asScala in the java files and looked if the files had deprecation warnings. There were a few that seemed to not.
If we remove these, then maybe it's ok. We should file a JIRA to clean them up though.
There was a problem hiding this comment.
We should file a JIRA to clean them up though
Jira not required - because in #13247 I will remove ReassignPartitionCommand.scala therefore all POJO inside it.
So all tests will forcefully use java versions of clasees.
The goal of this PR is to simplify review of the single test conversion and reduce changes in #13247
| } | ||
| } | ||
|
|
||
| private ReassignPartitionsCommand.VerifyAssignmentResult asScala(VerifyAssignmentResult res) { |
There was a problem hiding this comment.
I'm not sure how I feel about these asScala methods. I'm wondering if there is any way to give a better name or make this cleaner.
There was a problem hiding this comment.
Will these also be removed in the other PR you mentioned?
There was a problem hiding this comment.
Yes. asScala methods will be removed in #13247
|
@jolshan Thanks for the review. I resolve all your comments. Please, take a look one more time. |
|
@jolshan I answered all your question. Take a look, please. |
|
CI is OK after code review changes. |
|
Hey sorry. I was off for the weekend. I can take another look. |
|
@jolshan Thank you very much for the review and merge. Appreciate it. |
| testImplementation project(':connect:api') | ||
| testImplementation project(':connect:runtime') | ||
| testImplementation project(':connect:runtime').sourceSets.test.output | ||
| testImplementation project(':storage:api').sourceSets.main.output |
There was a problem hiding this comment.
@nizhikov
This gradle change is breaking trunk builds for me locally, should this be :storage:storage-api instead?
There was a problem hiding this comment.
I see builds fail on jenkins similarly -
https://lists.apache.org/thread/qnscvw8nb3dscrkm43r7g5224067jzc6
There was a problem hiding this comment.
Hello.
Please, take a look at jenkins build of trunk after this merged - https://ci-builds.apache.org/blue/organizations/jenkins/Kafka%2Fkafka/detail/trunk/2248/pipeline
Looks like it builds successfully.
Can you, please, clarify, how you trying to build trunk and what exactly fails?
There was a problem hiding this comment.
It seems like 7553d3f breaks compilation.
There was a problem hiding this comment.
I will provide fix in the nearest time.
There was a problem hiding this comment.
I was worried for a moment since I definitely checked the build on this 😅 Glad it was sorted.
There was a problem hiding this comment.
@nizhikov i can see its fixed in trunk, thanks.
…he#14456) This PR is part of apache#13247 It contains ReassignPartitionsIntegrationTest rewritten in java. Goal of PR is reduce changes size in main PR. Reviewers: Taras Ledkov <tledkov@apache.org>, Justine Olshan <jolshan@confluent.io>
…he#14456) This PR is part of apache#13247 It contains ReassignPartitionsIntegrationTest rewritten in java. Goal of PR is reduce changes size in main PR. Reviewers: Taras Ledkov <tledkov@apache.org>, Justine Olshan <jolshan@confluent.io>
This PR is part of #13247
It contains
ReassignPartitionsIntegrationTestrewritten in java.Goal of PR is reduce changes size in main PR.
Committer Checklist (excluded from commit message)