Browse Source

HDFS-2287. TestParallelRead has a small off-by-one bug. Contributed by Todd Lipcon.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1162005 13f79535-47bb-0310-9956-ffa450edef68
Todd Lipcon 14 years ago
parent
commit
23e7fc4f46

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -5,6 +5,9 @@ Trunk (unreleased changes)
     HDFS-395.  DFS Scalability: Incremental block reports. (Tomasz Nykiel
                via hairong)
 
+  BUG FIXES
+    HDFS-2287. TestParallelRead has a small off-by-one bug. (todd)
+
 Release 0.23.0 - Unreleased
 
   INCOMPATIBLE CHANGES

+ 4 - 4
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestParallelRead.java

@@ -109,11 +109,11 @@ public class TestParallelRead {
             pRead(startOff, len);
             bytesRead += len;
           }
-        } catch (Exception ex) {
+        } catch (Throwable t) {
           LOG.error(getName() + ": Error while testing read at " + startOff +
                     " length " + len);
           error = true;
-          fail(ex.getMessage());
+          fail(t.getMessage());
         }
       }
     }
@@ -135,8 +135,8 @@ public class TestParallelRead {
      */
     private void read(int start, int len) throws Exception {
       assertTrue(
-          "Bad args: " + start + " + " + len + " should be < " + fileSize,
-          start + len < fileSize);
+          "Bad args: " + start + " + " + len + " should be <= " + fileSize,
+          start + len <= fileSize);
       DFSInputStream dis = testInfo.dis;
 
       synchronized (dis) {