Re: [PR] KAFKA-20045: Fix flaky test testDescribeStreamsGroupsNotReady [kafka]
lucasbru merged PR #21267: URL: https://github.com/apache/kafka/pull/21267 -- 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]
Re: [PR] KAFKA-20045: Fix flaky test testDescribeStreamsGroupsNotReady [kafka]
lucasbru commented on PR #21267: URL: https://github.com/apache/kafka/pull/21267#issuecomment-3720612906 @lianetm Thanks for the comments. All addressed -- 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]
Re: [PR] KAFKA-20045: Fix flaky test testDescribeStreamsGroupsNotReady [kafka]
lianetm commented on code in PR #21267:
URL: https://github.com/apache/kafka/pull/21267#discussion_r2669815145
##
core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala:
##
@@ -4458,7 +4457,6 @@ class PlaintextAdminIntegrationTest extends
BaseAdminIntegrationTest {
}
}
- @Flaky("KAFKA-20045")
@Test
def testDescribeStreamsGroupsNotReady(): Unit = {
Review Comment:
this test has the Flaky tag on trunk, let's remove it with this PR
--
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]
Re: [PR] KAFKA-20045: Fix flaky test testDescribeStreamsGroupsNotReady [kafka]
lianetm commented on code in PR #21267:
URL: https://github.com/apache/kafka/pull/21267#discussion_r2669803363
##
core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala:
##
@@ -4476,7 +4476,7 @@ class PlaintextAdminIntegrationTest extends
BaseAdminIntegrationTest {
TestUtils.waitUntilTrue(() => {
val firstGroup = client.listGroups().all().get().stream()
.filter(g => g.groupId() == streamsGroupId).findFirst().orElse(null)
-firstGroup.groupState().orElse(null) == GroupState.NOT_READY &&
firstGroup.groupId() == streamsGroupId
+firstGroup != null && firstGroup.groupState().orElse(null) ==
GroupState.NOT_READY && firstGroup.groupId() == streamsGroupId
Review Comment:
yeap, would it make sense to apply the fix consistently to the other tests
too? (`testDescribeStreamsGroups`,
`testDescribeStreamsGroupsForStatelessTopology` and
`testListStreamsGroupOffsets` it seems, even though they haven't been flaky so
far)
##
core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala:
##
@@ -4476,7 +4476,7 @@ class PlaintextAdminIntegrationTest extends
BaseAdminIntegrationTest {
TestUtils.waitUntilTrue(() => {
val firstGroup = client.listGroups().all().get().stream()
.filter(g => g.groupId() == streamsGroupId).findFirst().orElse(null)
-firstGroup.groupState().orElse(null) == GroupState.NOT_READY &&
firstGroup.groupId() == streamsGroupId
+firstGroup != null && firstGroup.groupState().orElse(null) ==
GroupState.NOT_READY && firstGroup.groupId() == streamsGroupId
Review Comment:
also makes sense to me (only for the tests that filter the stream)
--
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]
Re: [PR] KAFKA-20045: Fix flaky test testDescribeStreamsGroupsNotReady [kafka]
Copilot commented on code in PR #21267:
URL: https://github.com/apache/kafka/pull/21267#discussion_r2669627555
##
core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala:
##
@@ -4476,7 +4476,7 @@ class PlaintextAdminIntegrationTest extends
BaseAdminIntegrationTest {
TestUtils.waitUntilTrue(() => {
val firstGroup = client.listGroups().all().get().stream()
.filter(g => g.groupId() == streamsGroupId).findFirst().orElse(null)
-firstGroup.groupState().orElse(null) == GroupState.NOT_READY &&
firstGroup.groupId() == streamsGroupId
+firstGroup != null && firstGroup.groupState().orElse(null) ==
GroupState.NOT_READY && firstGroup.groupId() == streamsGroupId
Review Comment:
The similar test method testDescribeStreamsGroups (line 4432) has the same
potential NullPointerException issue where it checks firstGroup.groupState()
without first verifying firstGroup is not null. For consistency and to prevent
the same flaky test behavior, it should also be updated to check firstGroup !=
null before accessing its methods.
```suggestion
if (firstGroup == null) {
false
} else {
firstGroup.groupState().orElse(null) == GroupState.NOT_READY &&
firstGroup.groupId() == streamsGroupId
}
```
##
core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala:
##
@@ -4476,7 +4476,7 @@ class PlaintextAdminIntegrationTest extends
BaseAdminIntegrationTest {
TestUtils.waitUntilTrue(() => {
val firstGroup = client.listGroups().all().get().stream()
.filter(g => g.groupId() == streamsGroupId).findFirst().orElse(null)
-firstGroup.groupState().orElse(null) == GroupState.NOT_READY &&
firstGroup.groupId() == streamsGroupId
+firstGroup != null && firstGroup.groupState().orElse(null) ==
GroupState.NOT_READY && firstGroup.groupId() == streamsGroupId
Review Comment:
The condition check is redundant. Once you verify firstGroup != null,
checking firstGroup.groupId() == streamsGroupId is unnecessary because the
filter already ensures that g.groupId() == streamsGroupId. Only groups matching
this condition can be found by findFirst(). Consider simplifying the condition
to just check firstGroup != null && firstGroup.groupState().orElse(null) ==
GroupState.NOT_READY.
```suggestion
firstGroup != null && firstGroup.groupState().orElse(null) ==
GroupState.NOT_READY
```
--
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]
