This is an automated email from the ASF dual-hosted git repository.
manikumar pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new 9a32ea9 KAFKA-8098: fix the flaky test by disabling the auto commit
to avoid member rejoining
9a32ea9 is described below
commit 9a32ea9e5248172bb67723165afda462fd6c53d0
Author: Luke Chen <[email protected]>
AuthorDate: Sat Sep 19 16:28:24 2020 +0530
KAFKA-8098: fix the flaky test by disabling the auto commit to avoid member
rejoining
In the test, we first test removing 1 member from group, and then test
removing the other 2 members from group, and it failed sometimes at the 2nd
member number assert. After investigation, I found it's because we enabled auto
commit for the consumers(default setting), and the removed consumer offset
commit will get the `UNKNOWN_MEMBER_ID` error, which will then make the member
rejoin. (check ConsumerCoordinator#OffsetCommitResponseHandler) So, that's why
after the 2nd members removin [...]
I set the consumer config to disable the auto commit to fix this issue.
Thanks.
Author: Luke Chen <[email protected]>
Reviewers: Manikumar Reddy <[email protected]>
Closes #9062 from showuon/KAFKA-8098
---
.../scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala | 3 +++
1 file changed, 3 insertions(+)
diff --git
a/core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala
b/core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala
index 31c0426..ebe8ff2 100644
---
a/core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala
+++
b/core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala
@@ -1044,6 +1044,9 @@ class PlaintextAdminIntegrationTest extends
BaseAdminIntegrationTest {
def createProperties(groupInstanceId: String): Properties = {
val newConsumerConfig = new Properties(consumerConfig)
+ // We need to disable the auto commit because after the members got
removed from group, the offset commit
+ // will cause the member rejoining and the test will be flaky (check
ConsumerCoordinator#OffsetCommitResponseHandler)
+
newConsumerConfig.setProperty(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "false")
newConsumerConfig.setProperty(ConsumerConfig.GROUP_ID_CONFIG,
testGroupId)
newConsumerConfig.setProperty(ConsumerConfig.CLIENT_ID_CONFIG,
testClientId)
if (groupInstanceId != EMPTY_GROUP_INSTANCE_ID) {