Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
[branch-2.11] Fix failed GroupMetadataManagerTest (#1934)
Browse files Browse the repository at this point in the history
### Motivation

When running `GroupMetadataManagerTest`,
`testOffsetWriteAfterGroupRemoved` will be called after
`testOffsetTopicNumPartitionsModify`, which changes the
`offsetTopicNumPartitions` to 100 so that `consumerGroupPartitionId`
will be 74 while `groupPartitionId` is 0, and then the group metadata
will be sent to partition 0 while `scheduleLoadGroupAndOffsets` will
read from partition 74. Since no group metadata is loaded,

### Modifications

Migrate the fix in #1759 to
reset the `offsetTopicNumPartitions` before and after each method.
  • Loading branch information
BewareMyPower committed Jul 2, 2023
1 parent c043a69 commit ae5d500
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public void cleanup() throws Exception {

@BeforeMethod
protected void setUp() throws PulsarClientException, PulsarAdminException {
conf.setOffsetsTopicNumPartitions(numOffsetsPartitions);
producerBuilder = pulsarClient.newProducer(Schema.BYTEBUFFER);
readerBuilder = pulsarClient.newReader(Schema.BYTEBUFFER)
.startMessageId(MessageId.earliest);
Expand Down Expand Up @@ -167,6 +168,7 @@ protected void setUp() throws PulsarClientException, PulsarAdminException {

@AfterMethod
protected void tearDown() throws PulsarClientException {
conf.setOffsetsTopicNumPartitions(numOffsetsPartitions);
if (consumer != null) {
consumer.close();
}
Expand Down

0 comments on commit ae5d500

Please sign in to comment.