From a6cc9bafa82848063c198be3f3cd3713f324cce5 Mon Sep 17 00:00:00 2001 From: Arun Murthy Date: Wed, 19 Oct 2011 22:51:51 +0000 Subject: [PATCH] HDFS-2445. Ensure failed tests exit with proper error code. Contributed by Jonathan Eagles. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1186550 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../test/java/org/apache/hadoop/test/HdfsTestDriver.java | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 1b964c7ea89..1fb627b498c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1251,6 +1251,9 @@ Release 0.23.0 - Unreleased HDFS-2172. Address findbugs and javadoc warnings in HDFS-1073 branch. (todd) + HDFS-2445. Ensure failed tests exit with proper error code. (Jonathan + Eagles via acmurthy) + Release 0.22.0 - Unreleased INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/test/HdfsTestDriver.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/test/HdfsTestDriver.java index a0dfcb4b49b..709a5012bfb 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/test/HdfsTestDriver.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/test/HdfsTestDriver.java @@ -43,14 +43,17 @@ public class HdfsTestDriver { } public void run(String argv[]) { + int exitCode = -1; try { - pgd.driver(argv); + exitCode = pgd.driver(argv); } catch(Throwable e) { e.printStackTrace(); } + + System.exit(exitCode); } public static void main(String argv[]){ new HdfsTestDriver().run(argv); } -} \ No newline at end of file +}