adoroszlai commented on a change in pull request #3216:
URL: https://github.com/apache/ozone/pull/3216#discussion_r833211677



##########
File path: 
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestOzoneContainer.java
##########
@@ -307,9 +291,18 @@ static void runTestBothGetandPutSmallFile(
           = ContainerTestHelper.getReadSmallFileRequest(client.getPipeline(),
           smallFileRequest.getPutSmallFile().getBlock());
       response = client.sendCommand(getSmallFileRequest);
-      Assert.assertArrayEquals(
-          smallFileRequest.getPutSmallFile().getData().toByteArray(),
-          response.getGetSmallFile().getData().getData().toByteArray());
+
+      Assert.assertEquals(ContainerProtos.Result.SUCCESS, 
response.getResult());
+
+      ContainerProtos.ReadChunkResponseProto chunkResponse =
+          response.getGetSmallFile().getData();
+      if (chunkResponse.hasDataBuffers()) {
+        Assert.assertArrayEquals(requestBytes,
+            chunkResponse.getDataBuffers().toByteArray());
+      } else {
+        Assert.assertArrayEquals(requestBytes,
+            chunkResponse.getData().toByteArray());
+      }

Review comment:
       ReadChunk response has two versions: one with single data array, one 
with multiple buffers.  Initially I thought that the test is failing because it 
checks `data` but response has `dataBuffer`.  This turned out to be false, but 
I still think handling both versions makes the test less fragile.
   
   In its current form the test reproduces HDDS-6473 with the failure you 
mentioned.




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