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


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/TestGetCommittedBlockLengthAndPutKey.java:
##########
@@ -110,12 +115,21 @@ public void tesGetCommittedBlockLength() throws Exception 
{
         ContainerTestHelper
             .getPutBlockRequest(pipeline, writeChunkRequest.getWriteChunk());
     client.sendCommand(putKeyRequest);
-    response = ContainerProtocolCalls
-        .getCommittedBlockLength(client, blockID, null);
+    GenericTestUtils.waitFor(() -> {
+      boolean success = true;
+      try {
+        response[0] = ContainerProtocolCalls
+            .getCommittedBlockLength(client, blockID, null);
+      } catch (IOException e) {
+        success = false;
+        LOG.error("Ignore the exception till wait: {}", e.getMessage());

Review Comment:
   Thank @nandakumar131 for review. Changes done.



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/TestGetCommittedBlockLengthAndPutKey.java:
##########
@@ -110,12 +115,21 @@ public void tesGetCommittedBlockLength() throws Exception 
{
         ContainerTestHelper
             .getPutBlockRequest(pipeline, writeChunkRequest.getWriteChunk());
     client.sendCommand(putKeyRequest);
-    response = ContainerProtocolCalls
-        .getCommittedBlockLength(client, blockID, null);
+    GenericTestUtils.waitFor(() -> {
+      boolean success = true;

Review Comment:
   Thank @nandakumar131 for review. Changes done.



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/TestGetCommittedBlockLengthAndPutKey.java:
##########
@@ -110,12 +115,21 @@ public void tesGetCommittedBlockLength() throws Exception 
{
         ContainerTestHelper
             .getPutBlockRequest(pipeline, writeChunkRequest.getWriteChunk());
     client.sendCommand(putKeyRequest);
-    response = ContainerProtocolCalls
-        .getCommittedBlockLength(client, blockID, null);
+    GenericTestUtils.waitFor(() -> {
+      boolean success = true;
+      try {
+        response[0] = ContainerProtocolCalls
+            .getCommittedBlockLength(client, blockID, null);
+      } catch (IOException e) {
+        success = false;
+        LOG.error("Ignore the exception till wait: {}", e.getMessage());
+      }
+      return success;
+    }, 1000, 5000);
     // make sure the block ids in the request and response are same.
     Assertions.assertTrue(
-        BlockID.getFromProtobuf(response.getBlockID()).equals(blockID));
-    Assertions.assertTrue(response.getBlockLength() == data.length);
+        BlockID.getFromProtobuf(response[0].getBlockID()).equals(blockID));
+    Assertions.assertTrue(response[0].getBlockLength() == data.length);

Review Comment:
   Thanks @ayushtkn for review, I have changed it to assertEquals.



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/TestGetCommittedBlockLengthAndPutKey.java:
##########
@@ -110,12 +115,21 @@ public void tesGetCommittedBlockLength() throws Exception 
{
         ContainerTestHelper
             .getPutBlockRequest(pipeline, writeChunkRequest.getWriteChunk());
     client.sendCommand(putKeyRequest);
-    response = ContainerProtocolCalls
-        .getCommittedBlockLength(client, blockID, null);
+    GenericTestUtils.waitFor(() -> {
+      boolean success = true;
+      try {
+        response[0] = ContainerProtocolCalls
+            .getCommittedBlockLength(client, blockID, null);
+      } catch (IOException e) {
+        success = false;
+        LOG.error("Ignore the exception till wait: {}", e.getMessage());
+      }
+      return success;
+    }, 1000, 5000);

Review Comment:
   What i observed was not very long time, it appears to be in millisec. so 
good idea to change to lower down the wait check value. I changed now to 500ms.



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