Class ShareMembershipManagerTest
java.lang.Object
org.apache.kafka.clients.consumer.internals.ShareMembershipManagerTest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetup()voidtearDown()voidvoidvoidvoidvoidvoidvoidvoidvoidvoidtestHeartbeatFailedResponseWhenLeavingGroupCompletesLeave(boolean retriableResponseError) voidvoidtestIgnoreHeartbeatResponseWhenNotInGroup(org.apache.kafka.clients.consumer.internals.MemberState state) voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidThis test should be the case when an assignment is sent to the member, and it cannot find it in metadata (temporarily).voidvoidvoidvoidvoidvoidThis test should be the case when an assignment is sent to the member, and it cannot find it in metadata (permanently, ex.voidThis test ensures that member goes back to STABLE when the broker sends assignment that removes the unresolved target the client has, without triggering a reconciliation.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidThis is the case where a member rejoins (due to fence).voidThis is the case where we receive a new assignment while reconciling an existing one.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidThis ensures that the client reconciles target assignments as soon as they are discovered in metadata, without depending on the broker to re-send the assignment.void
-
Constructor Details
-
ShareMembershipManagerTest
public ShareMembershipManagerTest()
-
-
Method Details
-
setup
@BeforeEach public void setup() -
tearDown
@AfterEach public void tearDown() -
testMembershipManagerRegistersForClusterMetadataUpdatesOnFirstJoin
@Test public void testMembershipManagerRegistersForClusterMetadataUpdatesOnFirstJoin() -
testReconcilingWhenReceivingAssignmentFoundInMetadata
@Test public void testReconcilingWhenReceivingAssignmentFoundInMetadata() -
testTransitionToReconcilingIfEmptyAssignmentReceived
@Test public void testTransitionToReconcilingIfEmptyAssignmentReceived() -
testMemberIdAndEpochResetOnFencedMembers
@Test public void testMemberIdAndEpochResetOnFencedMembers() -
testTransitionToFatal
@Test public void testTransitionToFatal() -
testTransitionToFailedWhenTryingToJoin
@Test public void testTransitionToFailedWhenTryingToJoin() -
testFencingWhenStateIsStable
@Test public void testFencingWhenStateIsStable() -
testListenersGetNotifiedOnTransitionsToFatal
@Test public void testListenersGetNotifiedOnTransitionsToFatal() -
testListenersGetNotifiedOnTransitionsToLeavingGroup
@Test public void testListenersGetNotifiedOnTransitionsToLeavingGroup() -
testListenersGetNotifiedOfMemberEpochUpdatesOnlyIfItChanges
@Test public void testListenersGetNotifiedOfMemberEpochUpdatesOnlyIfItChanges() -
testFencingWhenStateIsReconciling
@Test public void testFencingWhenStateIsReconciling() -
testFencingWhenStateIsLeaving
@Test public void testFencingWhenStateIsLeaving() -
testLeaveGroupEpoch
@Test public void testLeaveGroupEpoch() -
testSameAssignmentReconciledAgainWhenFenced
@Test public void testSameAssignmentReconciledAgainWhenFenced()This is the case where a member rejoins (due to fence). If the member gets the same assignment again, it should still reconcile and ack the assignment. -
testSameAssignmentReconciledAgainWithMissingTopic
@Test public void testSameAssignmentReconciledAgainWithMissingTopic()This is the case where we receive a new assignment while reconciling an existing one. The intermediate assignment is not applied, and a new assignment containing the same partitions is received and reconciled. In all assignments, one topic is not resolvable.We need to make sure that the last assignment is acked and applied, even though the set of partitions does not change. In this case, no rebalance listeners are run.
-
testDelayedMetadataUsedToCompleteAssignment
@Test public void testDelayedMetadataUsedToCompleteAssignment() -
testLeaveGroupWhenStateIsStable
@Test public void testLeaveGroupWhenStateIsStable() -
testHeartbeatSuccessfulResponseWhenLeavingGroupCompletesLeave
@Test public void testHeartbeatSuccessfulResponseWhenLeavingGroupCompletesLeave() -
testHeartbeatFailedResponseWhenLeavingGroupCompletesLeave
@ParameterizedTest @ValueSource(booleans={true,false}) public void testHeartbeatFailedResponseWhenLeavingGroupCompletesLeave(boolean retriableResponseError) -
testIgnoreHeartbeatResponseWhenNotInGroup
@ParameterizedTest @MethodSource("notInGroupStates") public void testIgnoreHeartbeatResponseWhenNotInGroup(org.apache.kafka.clients.consumer.internals.MemberState state) -
testIgnoreLeaveResponseWhenNotLeavingGroup
@Test public void testIgnoreLeaveResponseWhenNotLeavingGroup() -
testLeaveGroupWhenStateIsReconciling
@Test public void testLeaveGroupWhenStateIsReconciling() -
testIgnoreHeartbeatWhenLeavingGroup
@Test public void testIgnoreHeartbeatWhenLeavingGroup() -
testLeaveGroupWhenMemberOwnsAssignment
@Test public void testLeaveGroupWhenMemberOwnsAssignment() -
testFencedWhenAssignmentEmpty
@Test public void testFencedWhenAssignmentEmpty() -
testLeaveGroupWhenMemberAlreadyLeaving
@Test public void testLeaveGroupWhenMemberAlreadyLeaving() -
testLeaveGroupWhenMemberAlreadyLeft
@Test public void testLeaveGroupWhenMemberAlreadyLeft() -
testLeaveGroupWhenMemberIsStale
@Test public void testLeaveGroupWhenMemberIsStale() -
testFatalFailureWhenStateIsJoining
@Test public void testFatalFailureWhenStateIsJoining() -
testFatalFailureWhenStateIsStable
@Test public void testFatalFailureWhenStateIsStable() -
testFatalFailureWhenStateIsLeaving
@Test public void testFatalFailureWhenStateIsLeaving() -
testFatalFailureWhenMemberAlreadyLeft
@Test public void testFatalFailureWhenMemberAlreadyLeft() -
testUpdateStateFailsOnResponsesWithErrors
@Test public void testUpdateStateFailsOnResponsesWithErrors() -
testNewAssignmentReplacesPreviousOneWaitingOnMetadata
@Test public void testNewAssignmentReplacesPreviousOneWaitingOnMetadata()This test should be the case when an assignment is sent to the member, and it cannot find it in metadata (permanently, ex. topic deleted). The member will keep the assignment as waiting for metadata, but the following assignment received from the broker will not contain the deleted topic. The member will discard the assignment that was pending and proceed with the reconciliation of the new assignment. -
testNewEmptyAssignmentReplacesPreviousOneWaitingOnMetadata
@Test public void testNewEmptyAssignmentReplacesPreviousOneWaitingOnMetadata()This test ensures that member goes back to STABLE when the broker sends assignment that removes the unresolved target the client has, without triggering a reconciliation. In this case the member should discard the assignment that was unresolved and go back to STABLE with nothing to reconcile. -
testNewAssignmentNotInMetadataReplacesPreviousOneWaitingOnMetadata
@Test public void testNewAssignmentNotInMetadataReplacesPreviousOneWaitingOnMetadata() -
testUnresolvedTargetAssignmentIsReconciledWhenMetadataReceived
@Test public void testUnresolvedTargetAssignmentIsReconciledWhenMetadataReceived()This ensures that the client reconciles target assignments as soon as they are discovered in metadata, without depending on the broker to re-send the assignment. -
testMemberKeepsUnresolvedAssignmentWaitingForMetadataUntilResolved
@Test public void testMemberKeepsUnresolvedAssignmentWaitingForMetadataUntilResolved()This test should be the case when an assignment is sent to the member, and it cannot find it in metadata (temporarily). If the broker continues to send the assignment to the member, this one should keep it waiting for metadata and continue to request updates. -
testReconcileNewPartitionsAssignedWhenNoPartitionOwned
@Test public void testReconcileNewPartitionsAssignedWhenNoPartitionOwned() -
testReconcileNewPartitionsAssignedWhenOtherPartitionsOwned
@Test public void testReconcileNewPartitionsAssignedWhenOtherPartitionsOwned() -
testReconciliationSkippedWhenSameAssignmentReceived
@Test public void testReconciliationSkippedWhenSameAssignmentReceived() -
testReconcileNewPartitionsAssignedAndRevoked
@Test public void testReconcileNewPartitionsAssignedAndRevoked() -
testMetadataUpdatesReconcilesUnresolvedAssignments
@Test public void testMetadataUpdatesReconcilesUnresolvedAssignments() -
testMetadataUpdatesRequestsAnotherUpdateIfNeeded
@Test public void testMetadataUpdatesRequestsAnotherUpdateIfNeeded() -
testRevokePartitionsUsesTopicNamesLocalCacheWhenMetadataNotAvailable
@Test public void testRevokePartitionsUsesTopicNamesLocalCacheWhenMetadataNotAvailable() -
testOnSubscriptionUpdatedDoesNotTransitionToJoiningIfInGroup
@Test public void testOnSubscriptionUpdatedDoesNotTransitionToJoiningIfInGroup() -
testOnSubscriptionUpdatedTransitionsToJoiningOnPollIfNotInGroup
@Test public void testOnSubscriptionUpdatedTransitionsToJoiningOnPollIfNotInGroup() -
testTransitionToLeavingWhileReconcilingDueToStaleMember
@Test public void testTransitionToLeavingWhileReconcilingDueToStaleMember() -
testTransitionToLeavingWhileJoiningDueToStaleMember
@Test public void testTransitionToLeavingWhileJoiningDueToStaleMember() -
testTransitionToLeavingWhileStableDueToStaleMember
@Test public void testTransitionToLeavingWhileStableDueToStaleMember() -
testTransitionToLeavingWhileAcknowledgingDueToStaleMember
@Test public void testTransitionToLeavingWhileAcknowledgingDueToStaleMember() -
testStaleMemberDoesNotSendHeartbeatAndAllowsTransitionToJoiningToRecover
@Test public void testStaleMemberDoesNotSendHeartbeatAndAllowsTransitionToJoiningToRecover() -
testStaleMemberRejoinsWhenTimerResetsNoCallbacks
@Test public void testStaleMemberRejoinsWhenTimerResetsNoCallbacks() -
testMemberJoiningTransitionsToStableWhenReceivingEmptyAssignment
@Test public void testMemberJoiningTransitionsToStableWhenReceivingEmptyAssignment() -
testMetricsWhenHeartbeatFailed
@Test public void testMetricsWhenHeartbeatFailed() -
testRebalanceMetricsOnSuccessfulRebalance
@Test public void testRebalanceMetricsOnSuccessfulRebalance() -
testRebalanceMetricsOnFailedRebalance
@Test public void testRebalanceMetricsOnFailedRebalance()
-