You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "AndrewJSchofield (via GitHub)" <gi...@apache.org> on 2026/01/07 11:51:33 UTC
Re: [PR] MINOR: use known number of records in testComplexShareConsumer to prevent timeout issue [kafka]
AndrewJSchofield commented on code in PR #21235:
URL: https://github.com/apache/kafka/pull/21235#discussion_r2668130412
##########
clients/clients-integration-tests/src/test/java/org/apache/kafka/clients/consumer/ShareConsumerTest.java:
##########
@@ -2300,6 +2300,7 @@ public void testBehaviorOnDeliveryCountBoundary() {
@ClusterConfigProperty(key = "auto.create.topics.enable", value = "false"),
@ClusterConfigProperty(key = "group.share.partition.max.record.locks", value = "10000"),
@ClusterConfigProperty(key = "group.share.record.lock.duration.ms", value = "15000"),
+ @ClusterConfigProperty(key = "group.share.delivery.count.limit", value = "10"),
Review Comment:
This line is no longer necessary. Please remove it.
##########
clients/clients-integration-tests/src/test/java/org/apache/kafka/clients/consumer/ShareConsumerTest.java:
##########
@@ -2317,15 +2318,17 @@ public void testComplexShareConsumer() throws Exception {
ClientState prodState = new ClientState();
- // Produce messages until we want.
+ // Produce a fixed number of messages for deterministic testing.
+ int targetRecordCount = 2000;
service.execute(() -> {
try (Producer<byte[], byte[]> producer = createProducer()) {
- while (!prodState.done().get()) {
+ while (prodState.count().get() < targetRecordCount) {
Review Comment:
This could easily be a `do { ... } while(prodState.count().incrementAndGet() < targetRecordCount)`. Doesn't seem necessary to call the methods on the `AtomicInteger` twice per loop iteration.
--
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