From dd8aba3fadcd61990bfe8cd44475daec8d7dc714 Mon Sep 17 00:00:00 2001 From: Masatake Iwasaki Date: Fri, 6 May 2016 15:57:06 +0900 Subject: [PATCH] HDFS-2043. TestHFlush failing intermittently. Contributed by Lin Yiqun. --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ .../test/java/org/apache/hadoop/hdfs/TestHFlush.java | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index da1a4bcba26..64fb5c25c15 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -170,6 +170,8 @@ Release 2.7.3 - UNRELEASED HDFS-10347. Namenode report bad block method doesn't log the bad block or datanode. (Rushabh Shah via kihwal) + HDFS-2043. TestHFlush failing intermittently. (Lin Yiqun via iwasakims) + Release 2.7.2 - 2016-01-25 INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestHFlush.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestHFlush.java index a33ad18c6b3..99b81e29900 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestHFlush.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestHFlush.java @@ -484,8 +484,14 @@ public class TestHFlush { // If we got the exception, we shouldn't have interrupted status anymore. assertFalse(Thread.interrupted()); - // Now do a successful close. - stm.close(); + // Do the try-catch in the second stm.close() avoid that streamer was already + // closed in other places. + try { + // Now do a successful close. + stm.close(); + } catch (IOException e) { + System.out.println("Got expected exception during second close"); + } }