Skip to content

MINOR: Split up ShareConsumerTest#22017

Open
AndrewJSchofield wants to merge 4 commits intoapache:trunkfrom
AndrewJSchofield:share-consumer-test-split
Open

MINOR: Split up ShareConsumerTest#22017
AndrewJSchofield wants to merge 4 commits intoapache:trunkfrom
AndrewJSchofield:share-consumer-test-split

Conversation

@AndrewJSchofield
Copy link
Copy Markdown
Member

@AndrewJSchofield AndrewJSchofield commented Apr 9, 2026

Split up the excessively large ShareConsumerTest into a handful of
smaller source files.

Reviewers: Chia-Ping Tsai chia7712@gmail.com

@github-actions github-actions bot added tests Test fixes (including flaky tests) clients labels Apr 9, 2026
@AndrewJSchofield AndrewJSchofield added the KIP-932 Queues for Kafka label Apr 10, 2026
import static org.junit.jupiter.api.Assertions.assertTrue;

@Timeout(1200)
@Tag("integration")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need to add @Tag("integration") here? as I can see in @ClusterTest already covers this and is applied consistently across other test suites.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This one was an outlier and I'm not really sure why. I've added it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yes, it is redundant

Copy link
Copy Markdown
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.

@AndrewJSchofield thanks for this excellent refactor

@@ -131,7 +97,6 @@
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

@SuppressWarnings({"ClassFanOutComplexity", "ClassDataAbstractionCoupling"})
@Timeout(1200)
@Tag("integration")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ClusterTest covers this tag out of box, so we are good to skip it here

import static org.junit.jupiter.api.Assertions.assertTrue;

@Timeout(1200)
@Tag("integration")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yes, it is redundant

import static org.junit.jupiter.api.Assertions.assertTrue;

@Timeout(1200)
@Tag("integration")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ditto

import static org.junit.jupiter.api.Assertions.fail;

@Timeout(1200)
@Tag("integration")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ditto

}
)
public static class WithAssignmentBatchingDisabledTest extends ShareConsumerRackAwareTest {
@Tag("integration")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ditto

import static org.junit.jupiter.api.Assertions.assertTrue;

@Timeout(1200)
@Tag("integration")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ditto

import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.fail;

public class ShareConsumerTestBase {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should it be abstract?

assertEquals(1, records.count());

// Waiting until the acquisition lock expires.
Thread.sleep(20000);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we use a smaller group.share.record.lock.duration.ms here to make the test run faster?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's taken effort to get these tests to run reliably so I'm nervous about messing with the timeouts. It's a bit unpredictable ensuring that the timeout only happens when we want it to. Luckily there are few tests that wait like this.

Copy link
Copy Markdown
Contributor

@see-quick see-quick left a comment

Choose a reason for hiding this comment

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

👍, btw , I think there may be additional places in the integration tests where we are doing this redundantly (i.e., tagging integration) . It might be worth opening an issue so someone can clean it up and we can avoid these niche definitions. WDYT?

@chia7712
Copy link
Copy Markdown
Member

It might be worth opening an issue so someone can clean it up and we can avoid these niche definitions. WDYT?

That's a great idea! If you have some free cycles, please feel free to open a minor PR to address it. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients KIP-932 Queues for Kafka tests Test fixes (including flaky tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants