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


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/TestGetCommittedBlockLengthAndPutKey.java:
##########
@@ -110,12 +115,20 @@ public void tesGetCommittedBlockLength() throws Exception 
{
         ContainerTestHelper
             .getPutBlockRequest(pipeline, writeChunkRequest.getWriteChunk());
     client.sendCommand(putKeyRequest);
-    response = ContainerProtocolCalls
-        .getCommittedBlockLength(client, blockID, null);
+    GenericTestUtils.waitFor(() -> {
+      try {
+        response[0] = ContainerProtocolCalls
+            .getCommittedBlockLength(client, blockID, null);
+      } catch (IOException e) {
+        LOG.debug("Ignore the exception till wait: {}", e.getMessage());
+        return false;
+      }
+      return true;
+    }, 500, 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);
+    Assertions.assertEquals(BlockID.getFromProtobuf(response[0].getBlockID()),
+        blockID);
+    Assertions.assertEquals(response[0].getBlockLength(), data.length);

Review Comment:
   I think this is flipped, the expected goes first, just double check once



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