Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 12B2C185FD for ; Wed, 20 Apr 2016 22:37:09 +0000 (UTC) Received: (qmail 26548 invoked by uid 500); 20 Apr 2016 22:37:07 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 26242 invoked by uid 500); 20 Apr 2016 22:37:07 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 25460 invoked by uid 99); 20 Apr 2016 22:37:07 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Apr 2016 22:37:07 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 173F9E0977; Wed, 20 Apr 2016 22:37:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: wangda@apache.org To: common-commits@hadoop.apache.org Date: Wed, 20 Apr 2016 22:37:13 -0000 Message-Id: <1cdf5b92c478479c97b7056d0e39ecdd@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [08/13] hadoop git commit: HDFS-10291 TestShortCircuitLocalRead failing (stevel) HDFS-10291 TestShortCircuitLocalRead failing (stevel) (cherry picked from commit dd64769699ea4c85abdf9c590b9db680837e8b27) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/11e53d25 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/11e53d25 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/11e53d25 Branch: refs/heads/YARN-3368 Commit: 11e53d259caaa349a2b3f84b05d6032107dc60a9 Parents: b37e391 Author: Steve Loughran Authored: Mon Apr 18 10:26:35 2016 +0100 Committer: Wangda Tan Committed: Wed Apr 20 15:36:46 2016 -0700 ---------------------------------------------------------------------- .../hadoop/hdfs/shortcircuit/TestShortCircuitLocalRead.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/11e53d25/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/shortcircuit/TestShortCircuitLocalRead.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/shortcircuit/TestShortCircuitLocalRead.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/shortcircuit/TestShortCircuitLocalRead.java index f4fbebc..116dc88 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/shortcircuit/TestShortCircuitLocalRead.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/shortcircuit/TestShortCircuitLocalRead.java @@ -153,8 +153,11 @@ public class TestShortCircuitLocalRead { //Read a small number of bytes first. int nread = stm.read(actual, 0, 3); nread += stm.read(actual, nread, 2); - //Read across chunk boundary - nread += stm.read(actual, nread, 517); + int len = 517; + if (actual.length - nread >= len) { + //Read across chunk boundary + nread += stm.read(actual, nread, len); + } checkData(actual, readOffset, expected, nread, "A few bytes"); //Now read rest of it while (nread < actual.length) {