This is an automated email from the ASF dual-hosted git repository.
chihsuan 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 eb41f68fec7 HDDS-16942. Fix ineffective Mockito checks in pipeline and
EC tests (#11511)
eb41f68fec7 is described below
commit eb41f68fec7b583b1a5d059039fd962a83367b6b
Author: Andy Huang <[email protected]>
AuthorDate: Tue Oct 13 21:22:00 2026 +0800
HDDS-16942. Fix ineffective Mockito checks in pipeline and EC tests (#11511)
---
.../commandhandler/TestCreatePipelineCommandHandler.java | 5 +++--
.../scm/container/replication/TestECUnderReplicationHandler.java | 9 ++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git
a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCreatePipelineCommandHandler.java
b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCreatePipelineCommandHandler.java
index f7f88412486..1b5e67b9d8b 100644
---
a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCreatePipelineCommandHandler.java
+++
b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCreatePipelineCommandHandler.java
@@ -123,12 +123,13 @@ public void testCommandIdempotency() throws IOException {
.thenReturn(true);
final CreatePipelineCommandHandler commandHandler =
- new CreatePipelineCommandHandler(conf, MoreExecutors.directExecutor());
+ new CreatePipelineCommandHandler((leader, tls) -> raftClient,
+ MoreExecutors.directExecutor());
commandHandler.handle(command, ozoneContainer, stateContext,
connectionManager);
verify(writeChanel, times(0))
- .addGroup(pipelineID.getProtobuf(), datanodes);
+ .addGroup(pipelineID.getProtobuf(), datanodes,
Collections.nCopies(datanodes.size(), 0));
verify(raftClientGroupManager, times(0))
.add(any(RaftGroup.class));
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 bef8f5aa363..ea01fa878e7 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
@@ -1206,8 +1206,8 @@ public void testUnderAndOverReplication() throws
IOException {
/**
* HDDS-7683 was a case where the maintenance logic was calling the placement
- * policy requesting zero nodes. This test asserts that it is never called
- * with zero nodes to ensure that issue is fixed.
+ * policy requesting zero nodes. This test asserts that only decommission
+ * replication calls the placement policy, without an unnecessary
maintenance call.
*/
@Test
public void testMaintenanceDoesNotRequestZeroNodes() throws IOException {
@@ -1236,9 +1236,8 @@ public void testMaintenanceDoesNotRequestZeroNodes()
throws IOException {
handler.processAndSendCommands(availableReplicas,
emptyList(), result, 1);
assertEquals(1, commandsSent.size());
- verify(ecPlacementPolicy, times(0))
- .chooseDatanodes(anyList(), isNull(), eq(0), anyLong(),
- anyLong());
+ verify(ecPlacementPolicy, times(1))
+ .chooseDatanodes(anyList(), anyList(), isNull(), anyInt(), anyLong(),
anyLong());
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]