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
This commit is contained in:
Todd Lipcon 2011-08-26 06:51:57 +00:00
parent 7cf49f5d9c
commit 23e7fc4f46
2 changed files with 7 additions and 4 deletions

View File

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

View File

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