hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lium...@apache.org
Subject hadoop git commit: HDFS-11739. Fix regression in tests caused by YARN-679. Contributed by Steve Loughran
Date Wed, 03 May 2017 18:23:04 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk d4631e466 -> 83dded556


HDFS-11739. Fix regression in tests caused by YARN-679. Contributed by Steve Loughran


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/83dded55
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/83dded55
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/83dded55

Branch: refs/heads/trunk
Commit: 83dded556dc179fcff078451fb80533065e116f0
Parents: d4631e4
Author: Mingliang Liu <liuml07@apache.org>
Authored: Wed May 3 11:22:44 2017 -0700
Committer: Mingliang Liu <liuml07@apache.org>
Committed: Wed May 3 11:22:44 2017 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/util/ExitUtil.java       | 8 ++++++--
 .../hdfs/server/namenode/TestMetadataVersionOutput.java      | 4 +++-
 .../org/apache/hadoop/hdfs/server/namenode/TestStartup.java  | 5 +++--
 .../apache/hadoop/mapred/gridmix/TestGridmixSubmission.java  | 3 ++-
 4 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/83dded55/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ExitUtil.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ExitUtil.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ExitUtil.java
index 5642a23..dbe6663 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ExitUtil.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ExitUtil.java
@@ -38,6 +38,10 @@ public final class ExitUtil {
   private static volatile boolean systemHaltDisabled = false;
   private static volatile ExitException firstExitException;
   private static volatile HaltException firstHaltException;
+  /** Message raised from an exit exception if none were provided: {@value}. */
+  public static final String EXIT_EXCEPTION_MESSAGE = "ExitException";
+  /** Message raised from a halt exception if none were provided: {@value}. */
+  public static final String HALT_EXCEPTION_MESSAGE = "HaltException";
 
   private ExitUtil() {
   }
@@ -285,7 +289,7 @@ public final class ExitUtil {
    * @throws ExitException if {@link System#exit(int)} is disabled.
    */
   public static void terminate(int status) throws ExitException {
-    terminate(status, "");
+    terminate(status, EXIT_EXCEPTION_MESSAGE);
   }
 
   /**
@@ -306,7 +310,7 @@ public final class ExitUtil {
    * @throws HaltException if {@link Runtime#halt(int)} is disabled.
    */
   public static void halt(int status) throws HaltException {
-    halt(status, "");
+    halt(status, HALT_EXCEPTION_MESSAGE);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hadoop/blob/83dded55/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestMetadataVersionOutput.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestMetadataVersionOutput.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestMetadataVersionOutput.java
index dc8f70a..e1663e2 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestMetadataVersionOutput.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestMetadataVersionOutput.java
@@ -24,6 +24,8 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
 
 import org.apache.hadoop.hdfs.server.common.HdfsServerConstants;
+import org.apache.hadoop.util.ExitUtil;
+
 import org.junit.After;
 import org.junit.Test;
 
@@ -78,7 +80,7 @@ public class TestMetadataVersionOutput {
       try {
         NameNode.createNameNode(new String[] { "-metadataVersion" }, conf);
       } catch (Exception e) {
-        assertExceptionContains("ExitException", e);
+        assertExceptionContains(ExitUtil.EXIT_EXCEPTION_MESSAGE, e);
       }
     /* Check if meta data version is printed correctly. */
       final String verNumStr = HdfsServerConstants.NAMENODE_LAYOUT_VERSION + "";

http://git-wip-us.apache.org/repos/asf/hadoop/blob/83dded55/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStartup.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStartup.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStartup.java
index 8c2acf6..29a6064 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStartup.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStartup.java
@@ -425,8 +425,9 @@ public class TestStartup {
       SecondaryNameNode.main(argv);
       fail("Failed to handle runtime exceptions during SNN startup!");
     } catch (ExitException ee) {
-      GenericTestUtils.assertExceptionContains("ExitException", ee);
-      assertTrue("Didn't termiated properly ", ExitUtil.terminateCalled());
+      GenericTestUtils.assertExceptionContains(
+          ExitUtil.EXIT_EXCEPTION_MESSAGE, ee);
+      assertTrue("Didn't terminate properly ", ExitUtil.terminateCalled());
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/83dded55/hadoop-tools/hadoop-gridmix/src/test/java/org/apache/hadoop/mapred/gridmix/TestGridmixSubmission.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-gridmix/src/test/java/org/apache/hadoop/mapred/gridmix/TestGridmixSubmission.java
b/hadoop-tools/hadoop-gridmix/src/test/java/org/apache/hadoop/mapred/gridmix/TestGridmixSubmission.java
index f1800c1..d4bfddc 100644
--- a/hadoop-tools/hadoop-gridmix/src/test/java/org/apache/hadoop/mapred/gridmix/TestGridmixSubmission.java
+++ b/hadoop-tools/hadoop-gridmix/src/test/java/org/apache/hadoop/mapred/gridmix/TestGridmixSubmission.java
@@ -39,6 +39,7 @@ import java.io.IOException;
 import java.io.PrintStream;
 import java.util.zip.GZIPInputStream;
 
+import static org.apache.hadoop.test.GenericTestUtils.assertExceptionContains;
 import static org.junit.Assert.*;
 
 public class TestGridmixSubmission extends CommonJobTest {
@@ -185,7 +186,7 @@ public class TestGridmixSubmission extends CommonJobTest {
       DebugGridmix.main(argv);
 
     } catch (ExitUtil.ExitException e) {
-      assertEquals("ExitException", e.getMessage());
+      assertExceptionContains(ExitUtil.EXIT_EXCEPTION_MESSAGE, e);
       ExitUtil.resetFirstExitException();
     } finally {
       System.setErr(oldOut);


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message