This is an automated email from the ASF dual-hosted git repository.
jsancio pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new a6d86b9998 MINOR: Verify stopReplica if broker epoch not stale (#12040)
a6d86b9998 is described below
commit a6d86b9998b4cdcdda40cedc5da2f7e695e39ee1
Author: José Armando García Sancio <[email protected]>
AuthorDate: Wed Apr 13 09:05:27 2022 -0700
MINOR: Verify stopReplica if broker epoch not stale (#12040)
Verify that ReplicaManager.stopReplica is called if the stop replica
request doesn't result in a stale broker epoch error.
Reviewers: Mickael Maison <[email protected]>
---
core/src/test/scala/unit/kafka/server/KafkaApisTest.scala | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/core/src/test/scala/unit/kafka/server/KafkaApisTest.scala
b/core/src/test/scala/unit/kafka/server/KafkaApisTest.scala
index 2668303cfe..b72deafdf1 100644
--- a/core/src/test/scala/unit/kafka/server/KafkaApisTest.scala
+++ b/core/src/test/scala/unit/kafka/server/KafkaApisTest.scala
@@ -3192,6 +3192,14 @@ class KafkaApisTest {
)
val stopReplicaResponse = capturedResponse.getValue
assertEquals(expectedError, stopReplicaResponse.error())
+ if (expectedError != Errors.STALE_BROKER_EPOCH) {
+ verify(replicaManager).stopReplicas(
+ ArgumentMatchers.eq(request.context.correlationId),
+ ArgumentMatchers.eq(controllerId),
+ ArgumentMatchers.eq(controllerEpoch),
+ ArgumentMatchers.eq(stopReplicaRequest.partitionStates().asScala)
+ )
+ }
}
@Test