mukul1987 commented on a change in pull request #1019: HDDS-1603. Handle Ratis
Append Failure in Container State Machine. Contributed by Supratim Deka
URL: https://github.com/apache/hadoop/pull/1019#discussion_r300932058
##########
File path:
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineClose.java
##########
@@ -180,4 +188,77 @@ public void testPipelineCloseWithPipelineAction() throws
Exception {
} catch (PipelineNotFoundException e) {
}
}
+
+ @Test
+ public void testPipelineCloseWithLogFailure() throws IOException {
+
+ EventQueue eventQ = (EventQueue) scm.getEventQueue();
+ PipelineActionHandler pipelineActionTest =
+ Mockito.mock(PipelineActionHandler.class);
+ eventQ.addHandler(SCMEvents.PIPELINE_ACTIONS, pipelineActionTest);
+ ArgumentCaptor<PipelineActionsFromDatanode> actionCaptor =
+ ArgumentCaptor.forClass(PipelineActionsFromDatanode.class);
+
+ ContainerInfo containerInfo = containerManager
+ .allocateContainer(RATIS, THREE, "testOwner");
+ ContainerWithPipeline containerWithPipeline =
+ new ContainerWithPipeline(containerInfo,
+ pipelineManager.getPipeline(containerInfo.getPipelineID()));
+ Pipeline openPipeline = containerWithPipeline.getPipeline();
+ RaftGroupId groupId = RaftGroupId.valueOf(openPipeline.getId().getId());
+
+ try {
+ pipelineManager.getPipeline(openPipeline.getId());
+ } catch (PipelineNotFoundException e) {
+ Assert.assertTrue("pipeline should exist", false);
Review comment:
In Junit, the test will exit if an uncaught exception is thrown, so this
might not be needed.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]