sodonnel commented on code in PR #4399:
URL: https://github.com/apache/ozone/pull/4399#discussion_r1138343205
##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestOverReplicatedProcessor.java:
##########
@@ -78,23 +71,17 @@ public void setup() {
}
@Test
- public void testDeleteContainerCommand() throws IOException {
+ public void testSuccessfulRun() throws IOException {
ContainerInfo container = ReplicationTestUtil
.createContainer(HddsProtos.LifeCycleState.CLOSED, repConfig);
queue.enqueue(new OverReplicatedHealthResult(
container, 3, false));
- Set<Pair<DatanodeDetails, SCMCommand<?>>> commands = new HashSet<>();
- DeleteContainerCommand cmd =
- new DeleteContainerCommand(container.getContainerID());
- cmd.setReplicaIndex(5);
- commands.add(Pair.of(MockDatanodeDetails.randomDatanodeDetails(), cmd));
- Mockito
- .when(replicationManager.processOverReplicatedContainer(any()))
- .thenReturn(commands);
+ Mockito.when(replicationManager.processOverReplicatedContainer(any()))
+ .thenReturn(1);
overReplicatedProcessor.processAll();
-
- Mockito.verify(replicationManager).sendDatanodeCommand(any(), any(),
any());
Review Comment:
I decided the tests here didn't need to validate the functionality of
replicationManager actually sending commands. All the tests here need to do, is
validate a successful run does not requeue the command, while a failed run does
requeue, as that is basically the only thing the processor does now.
Sending the commands is internal to RM now (before RM returned the commands
and then this processor sent them, so it was valid to test it does the
sending), which we cannot really verify with a mocked RM anyway.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]