Skip to content

Conversation

lucliu1108
Copy link
Contributor

@lucliu1108 lucliu1108 commented Sep 6, 2025

This PR moves the topic creation before consumer creations in
PlaintextAdminIntegrationTest.testListGroups, to avoid potential
errors if consumer creates topic due to metadata update.

See discussion
#20244 (comment)

Reviewers: @chia7712, [email protected]

@github-actions github-actions bot added triage PRs from the community core Kafka Broker tests Test fixes (including flaky tests) small Small PRs labels Sep 6, 2025
@lucliu1108 lucliu1108 marked this pull request as ready for review September 6, 2025 23:28
@chia7712
Copy link
Member

chia7712 commented Sep 7, 2025

Gradle Test Run :core:test > Gradle Test Executor 33 > PlaintextAdminIntegrationTest > testListGroups() FAILED
    org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
        at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
        at app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
        at app//org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
        at app//org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
        at app//org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:31)
        at app//org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:183)
        at app//kafka.api.PlaintextAdminIntegrationTest.testListGroups(PlaintextAdminIntegrationTest.scala:2643)

The test is still flaky on my local machine. Perhaps it needs waitUntilTrue to ensure all groups are ready?

@lucliu1108
Copy link
Contributor Author

Added a waitUtilTrue to wait until all groups are stable before validating the listGroup contents.

Copy link
Contributor

@apalan60 apalan60 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucliu1108

Thanks for the fix. I looped this test 50 times locally and didn’t see any failures.
Also left a small suggestion.

filteredClassicGroups.forall(_.groupState().orElse(null) == GroupState.STABLE) &&
filteredConsumerGroups.forall(_.groupState().orElse(null) == GroupState.STABLE) &&
filteredShareGroups.forall(_.groupState().orElse(null) == GroupState.STABLE) &&
filteredClassicGroups.forall(_.groupState().orElse(null) == GroupState.STABLE) &&
Copy link
Contributor

@apalan60 apalan60 Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filteredClassicGroups.forall(_.groupState().orElse(null) == GroupState.STABLE) &&

It looks like this line is duplicated.

@lucliu1108 lucliu1108 requested a review from apalan60 September 9, 2025 17:31
Copy link
Member

@bbejeck bbejeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bbejeck bbejeck merged commit 0bc2c6e into apache:trunk Sep 9, 2025
24 checks passed
@bbejeck
Copy link
Member

bbejeck commented Sep 9, 2025

Merged #20496 into trunk

Copy link
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bbejeck Could you please use committer-tools/reviewers.py to format the reviewers before merging the PR?

filteredClassicGroups.forall(_.groupState().orElse(null) == GroupState.STABLE) &&
filteredConsumerGroups.forall(_.groupState().orElse(null) == GroupState.STABLE) &&
filteredShareGroups.forall(_.groupState().orElse(null) == GroupState.STABLE) &&
filteredStreamsGroups.forall(_.groupState().orElse(null) == GroupState.STABLE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also add the check for simple group?

@github-actions github-actions bot removed the triage PRs from the community label Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-approved core Kafka Broker small Small PRs tests Test fixes (including flaky tests)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants