This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 72855197ac HDDS-8675. Fix expectation in 
testUnderRepSentToOverRepHandlerIfNoNewNodes (#4795)
72855197ac is described below

commit 72855197ac21df693a61a4320dd6c28fdea23b69
Author: Siddhant Sangwan <[email protected]>
AuthorDate: Wed May 31 13:35:08 2023 +0530

    HDDS-8675. Fix expectation in testUnderRepSentToOverRepHandlerIfNoNewNodes 
(#4795)
---
 .../replication/TestECUnderReplicationHandler.java      | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git 
a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECUnderReplicationHandler.java
 
b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECUnderReplicationHandler.java
index 3e783bfd65..4ee5406b5a 100644
--- 
a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECUnderReplicationHandler.java
+++ 
b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECUnderReplicationHandler.java
@@ -466,29 +466,16 @@ public class TestECUnderReplicationHandler {
           () -> ecURH.processAndSendCommands(availableReplicas,
               Collections.emptyList(), underRep, 2));
 
-      // Now adjust replicas so it is also over replicated. This time rather
-      // than throwing it should call the OverRepHandler and return whatever it
+      // Now adjust replicas so it is also over replicated. This time before
+      // throwing it should call the OverRepHandler and return whatever it
       // returns, which in this case is a delete command for replica index 4.
       availableReplicas.add(overRepReplica);
 
-      Set<Pair<DatanodeDetails, SCMCommand<?>>> expectedDelete =
-          new HashSet<>();
-      expectedDelete.add(Pair.of(overRepReplica.getDatanodeDetails(),
-          createDeleteContainerCommand(container,
-              overRepReplica.getReplicaIndex())));
-
-      Mockito.when(replicationManager.processOverReplicatedContainer(
-          underRep)).thenAnswer(invocationOnMock -> {
-            commandsSent.addAll(expectedDelete);
-            return expectedDelete.size();
-          });
-      commandsSent.clear();
       assertThrows(SCMException.class,
           () -> ecURH.processAndSendCommands(availableReplicas,
               Collections.emptyList(), underRep, 2));
       Mockito.verify(replicationManager, times(1))
           .processOverReplicatedContainer(underRep);
-      Assertions.assertEquals(true, expectedDelete.equals(commandsSent));
     }
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to