devmadhuu commented on code in PR #3947:
URL: https://github.com/apache/ozone/pull/3947#discussion_r1047055234


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconTasks.java:
##########
@@ -89,6 +90,42 @@ public void shutdown() {
     }
   }
 
+  @Test
+  public void testSyncSCMContainerInfo() throws Exception {
+    ReconStorageContainerManagerFacade reconScm =
+        (ReconStorageContainerManagerFacade)
+            cluster.getReconServer().getReconStorageContainerManager();
+    StorageContainerManager scm = cluster.getStorageContainerManager();
+    ContainerManager scmContainerManager = scm.getContainerManager();
+    ContainerManager reconContainerManager = reconScm.getContainerManager();
+    final ContainerInfo container1 = scmContainerManager.allocateContainer(
+        RatisReplicationConfig.getInstance(
+            HddsProtos.ReplicationFactor.ONE), "admin");
+    final ContainerInfo container2 = scmContainerManager.allocateContainer(
+        RatisReplicationConfig.getInstance(
+            HddsProtos.ReplicationFactor.ONE), "admin");
+    reconContainerManager.allocateContainer(
+        RatisReplicationConfig.getInstance(
+            HddsProtos.ReplicationFactor.ONE), "admin");
+    scmContainerManager.updateContainerState(container1.containerID(),
+        HddsProtos.LifeCycleEvent.FINALIZE);
+    scmContainerManager.updateContainerState(container2.containerID(),
+        HddsProtos.LifeCycleEvent.FINALIZE);
+    scmContainerManager.updateContainerState(container1.containerID(),
+        HddsProtos.LifeCycleEvent.CLOSE);
+    scmContainerManager.updateContainerState(container2.containerID(),
+        HddsProtos.LifeCycleEvent.CLOSE);
+    int scmContainersCount = scmContainerManager.getContainers().size();
+    int reconContainersCount = reconContainerManager
+        .getContainers().size();
+    Assert.assertNotEquals(scmContainersCount, reconContainersCount);
+    reconScm.syncWithSCMContainerInfo();
+    scmContainersCount = scmContainerManager.getContainers().size();

Review Comment:
   @GeorgeJahad , yes this is the part of test. Check from line 118 to 126, at 
line 118, scmContainerCount taken and at line 119 reconContainersCount taken 
and AssertNotEquals should pass as they should not be equal in this specific 
test. After that at line 122, sync call happens with SCM for containers and 
then again same assert being repeated for equals, so after sync, assertEquals 
test will pass.



-- 
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]

Reply via email to