-
Notifications
You must be signed in to change notification settings - Fork 14.4k
KAFKA-19285: Added more tests in SharePartitionManagerTest #19778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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. I have left some comments because the tests don't quite seem to be doing what is suggested.
assertInstanceOf(ShareSessionContext.class, context1); | ||
assertFalse(((ShareSessionContext) context1).isSubsequent()); | ||
|
||
// The expected epoch from the share session should be 1, but we are passing 2. This should throw an exception. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't we passing FINAL_EPOCH?
// The expected epoch from the share session should be 1, but we are passing 2. This should throw an exception. | ||
assertDoesNotThrow( | ||
() -> sharePartitionManager.acknowledgeSessionUpdate("grp", | ||
new ShareRequestMetadata(memberId, ShareRequestMetadata.nextEpoch(ShareRequestMetadata.INITIAL_EPOCH)))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't we passing 1? The next epoch after the initial epoch is 1, isn't it?
assertInstanceOf(ShareSessionContext.class, context1); | ||
assertFalse(((ShareSessionContext) context1).isSubsequent()); | ||
|
||
// The expected epoch from the share session should be 1, but we are passing 2. This should throw an exception. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't we passing 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review. I understand the other places I forgot to update the log, but I believe in this referred place it is fine. The code does the following ->
ShareRequestMetadata.nextEpoch(ShareRequestMetadata.nextEpoch(ShareRequestMetadata.INITIAL_EPOCH))
ShareRequestMetadata.nextEpoch() is called twice, thereby increasing epoch from 0 to 2.
This PR includes more unit tests in the file SharePartitionManagerTest to improve the coverage