Skip to content

Fixes for PlainAdminIntegrationTest#testAlterShareGroupOffsets#228

Merged
fvaleri merged 6 commits into
showuon:cl3from
gaurav-narula:share-group-integration-test-fix
Jul 20, 2026
Merged

Fixes for PlainAdminIntegrationTest#testAlterShareGroupOffsets#228
fvaleri merged 6 commits into
showuon:cl3from
gaurav-narula:share-group-integration-test-fix

Conversation

@gaurav-narula

Copy link
Copy Markdown
Collaborator

Reverts #161 and #155 and brings in changes from upstream/trunk. The main one is KAFKA-19662 and the proceeding ones are required for the cherry-pick to apply cleanly

@gaurav-narula
gaurav-narula requested review from fvaleri and showuon July 17, 2026 14:25
@gaurav-narula gaurav-narula changed the title Share group integration test fix Fixes for PlainAdminIntegrationTest#testAlterShareGroupOffsets Jul 17, 2026
fvaleri
fvaleri previously approved these changes Jul 17, 2026

@fvaleri fvaleri left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

$ ./gradlew core:test --tests PlaintextAdminIntegrationTest.testDescribeTopicsWithIds

> Configure project :
Starting build with version 4.2.0-SNAPSHOT (commit id e52d05c2) using Gradle 8.14.1, Java 21 and Scala 2.13.16
Build properties: ignoreFailures=false, maxParallelForks=22, maxScalacThreads=8, maxTestRetries=0

> Task :core:test
kafka.api.PlaintextAdminIntegrationTest.testDescribeTopicsWithIds() failed, log available in /home/fvaleri/Documents/kafka/core/build/reports/testOutput/kafka.api.PlaintextAdminIntegrationTest.testDescribeTopicsWithIds().test.stdout

Gradle Test Run :core:test > Gradle Test Executor 171 > PlaintextAdminIntegrationTest > testDescribeTopicsWithIds() FAILED
    java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because the return value of "org.apache.kafka.common.requests.MetadataResponse$TopicMetadata.topic()" is null
        at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
        at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
        at org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:155)
        at kafka.api.PlaintextAdminIntegrationTest.testDescribeTopicsWithIds(PlaintextAdminIntegrationTest.scala:799)

        Caused by:
        java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because the return value of "org.apache.kafka.common.requests.MetadataResponse$TopicMetadata.topic()" is null
            at org.apache.kafka.clients.admin.KafkaAdminClient.getTopicDescriptionFromCluster(KafkaAdminClient.java:2521)
            at org.apache.kafka.clients.admin.KafkaAdminClient$8.handleResponse(KafkaAdminClient.java:2485)
            at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.handleResponses(KafkaAdminClient.java:1411)
            at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.processRequests(KafkaAdminClient.java:1565)
            at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1488)
            at java.base/java.lang.Thread.run(Thread.java:1583)

1 test completed, 1 failed

gaurav-narula and others added 6 commits July 20, 2026 09:18
This reverts commit 55efc8d, reversing
changes made to 1c8b6d3.
…ate"

This reverts commit 05f8874, reversing
changes made to 143e6cc.
This PR aims at cleaning up the tools module further by getting rid of
some extra code which can be replaced by `record`

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
…ader is unavailable (apache#20271)

This PR applies the same partition leader check for `StreamsGroupCommand` as
`ShareGroupCommand`  and `ConsumerGroupCommand` to avoid the command
execution timeout.

Reviewers: Lucas Brutschy <lucasbru@apache.org>
…hare-groups.sh (apache#20453)

The `kafka-share-groups.sh` tool checks whether a topic already has a
start-offset in the share group when resetting offsets. This is not
necessary. By removing the check, it is possible to set a start offset
for a topic which has not yet but will be subscribed in the future, thus
initialising the consumption point.

There is still a small piece of outstanding work to do with resetting
the offset for a non-existent group which should also create the group.
A subsequent PR will be used to address that.

Reviewers: Jimmy Wang <48462172+JimmyWang6@users.noreply.github.com>,
Lan Ding <isDing_L@163.com>, Apoorv Mittal <apoorvmittal10@gmail.com>
…e#20708)

This PR allows the kafka-share-groups.sh --reset-offsets tool to be used
to set offsets for topics which are not currently subscribed in a share
group. It also works if the share group does not yet exist. This brings
the capability in line with the equivalent function in
Kafka-consumer-groups.sh. The primary purpose is to allow offsets to be
set before the share group is first used as a way of initialising in a
known state.

Reviewers: Jimmy Wang <48462172+JimmyWang6@users.noreply.github.com>,
 Kuan-Po Tseng <brandboat@gmail.com>, Apoorv Mittal
 <apoorvmittal10@gmail.com>
@gaurav-narula
gaurav-narula force-pushed the share-group-integration-test-fix branch from e52d05c to f7e7d4c Compare July 20, 2026 08:19

@fvaleri fvaleri left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Thanks.

@fvaleri
fvaleri merged commit 87515c0 into showuon:cl3 Jul 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants