aswinshakil commented on a change in pull request #2847:
URL: https://github.com/apache/ozone/pull/2847#discussion_r752668381



##########
File path: 
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineManagerImpl.java
##########
@@ -650,6 +650,30 @@ public void testAddContainerWithClosedPipeline() throws 
Exception {
             pipelineID + " in closed state"));
   }
 
+  @Test
+  public void testPipelineCloseFlow() throws IOException {
+    GenericTestUtils.LogCapturer logCapturer = GenericTestUtils.LogCapturer
+            .captureLogs(LoggerFactory.getLogger(PipelineManagerImpl.class));
+    PipelineManagerImpl pipelineManager = createPipelineManager(true);
+    Pipeline pipeline = pipelineManager.createPipeline(
+            new RatisReplicationConfig(HddsProtos.ReplicationFactor.THREE));
+    PipelineID pipelineID = pipeline.getId();
+    pipelineManager.addContainerToPipeline(pipelineID, ContainerID.valueOf(1));
+    pipelineManager.closePipeline(pipeline, false);
+
+    String containerExpectedOutput =
+        "Containers closed for pipeline=" + pipeline;
+    String pipelineExpectedOutput =
+        "Pipeline " + pipeline + " moved to CLOSED state";
+    String logOutput = logCapturer.getOutput();
+    assertTrue(logOutput.contains(containerExpectedOutput));
+    assertTrue(logOutput.contains(pipelineExpectedOutput));
+
+    int containerLogIdx = logOutput.indexOf(containerExpectedOutput);

Review comment:
       Sounds good. I will make the changes.




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