Skip to content

Conversation

@JimmyWang6
Copy link
Contributor

@JimmyWang6 JimmyWang6 commented Oct 31, 2025

This PR updates the SharePartitionTest.java unit tests to use
AcknowledgeType enums instead of hardcoded byte values. This makes the
tests more readable and maintainable, and ensures that acknowledgement
types are referenced consistently throughout the codebase.

@github-actions github-actions bot added triage PRs from the community core Kafka Broker tests Test fixes (including flaky tests) KIP-932 Queues for Kafka labels Oct 31, 2025
Copy link
Member

@AndrewJSchofield AndrewJSchofield left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Just a couple of minor comments.

ackResult = sharePartition.acknowledge(
MEMBER_ID,
List.of(new ShareAcknowledgementBatch(20, 25, List.of((byte) 3))));
List.of(new ShareAcknowledgementBatch(20, 25, List.of(AcknowledgeType.RELEASE.id))));
Copy link
Member

Choose a reason for hiding this comment

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

3 is REJECT :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Done.

new ShareAcknowledgementBatch(5, 6, List.of(AcknowledgeType.RELEASE.id)),
new ShareAcknowledgementBatch(10, 18, List.of(
(byte) 2, (byte) 2, (byte) 2, (byte) 2, (byte) 2, (byte) 0, (byte) 0, (byte) 0, (byte) 2
AcknowledgeType.RELEASE.id, AcknowledgeType.RELEASE.id, AcknowledgeType.RELEASE.id, AcknowledgeType.RELEASE.id, AcknowledgeType.RELEASE.id, ACKNOWLEDGE_TYPE_GAP_ID, ACKNOWLEDGE_TYPE_GAP_ID, ACKNOWLEDGE_TYPE_GAP_ID, AcknowledgeType.RELEASE.id
Copy link
Member

Choose a reason for hiding this comment

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

Break the line now it's so long?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for comment, done.

@AndrewJSchofield AndrewJSchofield removed the triage PRs from the community label Oct 31, 2025
@JimmyWang6 JimmyWang6 changed the title MINOR: Use explicit AcknowledgeType enums in SharePartitionTest tests MINOR: Use explicit AcknowledgeType enums in SharePartitionTest Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-approved core Kafka Broker KIP-932 Queues for Kafka tests Test fixes (including flaky tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants