From 23e7fc4f462ac07134d5ca59049f81e8f24830ea Mon Sep 17 00:00:00 2001 From: Todd Lipcon Date: Fri, 26 Aug 2011 06:51:57 +0000 Subject: [PATCH] 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 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../java/org/apache/hadoop/hdfs/TestParallelRead.java | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 238d9aba55..a33030c5e5 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/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 diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestParallelRead.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestParallelRead.java index eb37422ad1..c5aec722fc 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestParallelRead.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestParallelRead.java @@ -109,11 +109,11 @@ public void run() { 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 boolean hasError() { */ 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) {