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 6b20afcd13 HDDS-12387. Cleanup TestContainerOperations (#7940)
6b20afcd13 is described below

commit 6b20afcd1363923e891e6ad9dfe33bb08b31d9e3
Author: Chia-Chuan Yu <[email protected]>
AuthorDate: Sat Feb 22 02:17:00 2025 +0800

    HDDS-12387. Cleanup TestContainerOperations (#7940)
---
 .../hadoop/hdds/scm/TestContainerOperations.java       | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestContainerOperations.java
 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestContainerOperations.java
index 6d462de6a0..68235657a1 100644
--- 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestContainerOperations.java
+++ 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestContainerOperations.java
@@ -46,7 +46,6 @@
 import org.apache.hadoop.hdds.scm.pipeline.Pipeline;
 import org.apache.hadoop.hdds.scm.pipeline.PipelineID;
 import org.apache.hadoop.hdds.scm.pipeline.PipelineNotFoundException;
-import 
org.apache.hadoop.hdds.scm.protocolPB.StorageContainerLocationProtocolClientSideTranslatorPB;
 import org.apache.hadoop.hdds.scm.server.StorageContainerManager;
 import org.apache.hadoop.hdds.scm.storage.ContainerProtocolCalls;
 import org.apache.hadoop.hdds.utils.IOUtils;
@@ -70,7 +69,6 @@ public abstract class TestContainerOperations implements 
NonHATests.TestCase {
   private static final int CONTAINER_LIST_LIMIT = 1;
 
   private ScmClient storageClient;
-  private StorageContainerLocationProtocolClientSideTranslatorPB 
storageContainerLocationClient;
   private XceiverClientManager xceiverClientManager;
 
   @BeforeAll
@@ -78,25 +76,23 @@ void setup() throws Exception {
     OzoneConfiguration clientConf = new 
OzoneConfiguration(cluster().getConf());
     clientConf.setInt(ScmConfigKeys.OZONE_SCM_CONTAINER_LIST_MAX_COUNT, 
CONTAINER_LIST_LIMIT);
     storageClient = new ContainerOperationClient(clientConf);
-    storageContainerLocationClient = 
cluster().getStorageContainerLocationClient();
     xceiverClientManager = new XceiverClientManager(cluster().getConf());
   }
 
   @AfterAll
   void cleanup() {
-    IOUtils.closeQuietly(storageContainerLocationClient, xceiverClientManager);
+    IOUtils.closeQuietly(xceiverClientManager);
   }
 
   @Test
   void testContainerStateMachineIdempotency() throws Exception {
-    ContainerWithPipeline container = storageContainerLocationClient
-        .allocateContainer(HddsProtos.ReplicationType.RATIS,
-            HddsProtos.ReplicationFactor.ONE, OzoneConsts.OZONE);
+    ContainerWithPipeline container = storageClient.createContainer(HddsProtos
+        .ReplicationType.RATIS, HddsProtos.ReplicationFactor
+        .ONE, OzoneConsts.OZONE);
     long containerID = container.getContainerInfo().getContainerID();
     Pipeline pipeline = container.getPipeline();
     XceiverClientSpi client = xceiverClientManager.acquireClient(pipeline);
-    //create the container
-    ContainerProtocolCalls.createContainer(client, containerID, null);
+
     // call create Container again
     BlockID blockID = ContainerTestHelper.getTestBlockID(containerID);
     byte[] data =
@@ -227,7 +223,7 @@ public void testNodeOperationalStates() throws Exception {
     DatanodeDetails node = nm.getAllNodes().get(0);
     nm.setNodeOperationalState(node, DECOMMISSIONING);
 
-    // All nodes should be returned as they are all in service
+    // Nodes not in DECOMMISSIONING state should be returned as they are in 
service
     int nodeCount = storageClient.queryNode(IN_SERVICE, HEALTHY,
         HddsProtos.QueryScope.CLUSTER, "").size();
     assertEquals(numOfDatanodes - 1, nodeCount);
@@ -263,7 +259,7 @@ public void testNodeOperationalStates() throws Exception {
         nodeCount = storageClient.queryNode(s, HEALTHY,
             HddsProtos.QueryScope.CLUSTER, "").size();
         if (s == IN_SERVICE) {
-          assertEquals(5, nodeCount);
+          assertEquals(cluster().getHddsDatanodes().size(), nodeCount);
         } else {
           assertEquals(1, nodeCount);
         }


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

Reply via email to