From fc362b1caf964507bf76586885897eb228c0dc5a Mon Sep 17 00:00:00 2001 From: Arun Murthy Date: Wed, 19 Oct 2011 22:54:23 +0000 Subject: [PATCH] MAPREDUCE-3179. Ensure failed tests exit with right error code. Contributed by Jonathan Eagles. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1186552 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../test/mapred/org/apache/hadoop/test/MapredTestDriver.java | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 1eb0807404..b710400c04 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -1703,6 +1703,9 @@ Release 0.23.0 - Unreleased MAPREDUCE-3212. Fix usage/help message for bin/yarn. (Bhallamudi Venkata Siva Kamesh via acmurthy) + MAPREDUCE-3179. Ensure failed tests exit with right error code. (Jonathan + Eagles via acmurthy) + Release 0.22.0 - Unreleased INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/test/MapredTestDriver.java b/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/test/MapredTestDriver.java index 26747cd5f2..4ab14adba1 100644 --- a/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/test/MapredTestDriver.java +++ b/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/test/MapredTestDriver.java @@ -107,11 +107,13 @@ public MapredTestDriver(ProgramDriver pgd) { } 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[]){