weimingdiit commented on code in PR #9925:
URL: https://github.com/apache/ozone/pull/9925#discussion_r2945020688


##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestHddsDispatcher.java:
##########
@@ -495,6 +496,50 @@ public void testWriteChunkWithCreateContainerFailure() 
throws IOException {
     }
   }
 
+  @Test
+  public void testWriteChunkWithContainerAlreadyExistsDoesNotMarkUnhealthy()
+      throws IOException {
+    String testDirPath = testDir.getPath();
+    try {
+      UUID scmId = UUID.randomUUID();
+      OzoneConfiguration conf = new OzoneConfiguration();
+      conf.set(HDDS_DATANODE_DIR_KEY, testDirPath);
+      conf.set(OzoneConfigKeys.OZONE_METADATA_DIRS, testDirPath);
+      DatanodeDetails dd = randomDatanodeDetails();
+      HddsDispatcher hddsDispatcher = createDispatcher(dd, scmId, conf);
+      ContainerCommandRequestProto initialWriteChunkRequest =
+          getWriteChunkRequest(dd.getUuidString(), 1L, 1L);
+
+      ContainerCommandResponseProto initialResponse =
+          hddsDispatcher.dispatch(initialWriteChunkRequest, null);
+      assertEquals(ContainerProtos.Result.SUCCESS, 
initialResponse.getResult());
+
+      ContainerCommandRequestProto writeChunkRequest =
+          getWriteChunkRequest(dd.getUuidString(), 1L, 2L);
+      HddsDispatcher mockDispatcher = spy(hddsDispatcher);
+      ContainerCommandResponseProto.Builder builder =
+          getContainerCommandResponse(writeChunkRequest,
+              ContainerProtos.Result.CONTAINER_ALREADY_EXISTS, "");

Review Comment:
   @Gargi-jais11 Thanks for your suggestion. The ut has been updated.



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