steveloughran commented on a change in pull request #2698:
URL: https://github.com/apache/hadoop/pull/2698#discussion_r578418389



##########
File path: 
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemRandomRead.java
##########
@@ -402,6 +399,18 @@ public void testSkipAndAvailableAndPosition() throws 
Exception {
               inputStream.getPos());
       assertEquals(testFileLength - inputStream.getPos(),
               inputStream.available());
+
+      skipped = inputStream.skip(testFileLength + 1); //goes to last byte
+      assertEquals(1, inputStream.available());

Review comment:
       can you add an error message to all these asserts?

##########
File path: 
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsInputStream.java
##########
@@ -583,8 +583,8 @@ public synchronized long skip(long n) throws IOException {
       newPos = 0;
       n = newPos - currentPos;
     }
-    if (newPos > contentLength) {
-      newPos = contentLength;
+    if (newPos >= contentLength) {

Review comment:
       what does skip(0) on a 0-byte file do? I don't think we've ever looked 
at that?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to