From cd361fa490b1ca09d964df443a389bf41beba5f2 Mon Sep 17 00:00:00 2001 From: Anu Engineer Date: Wed, 5 Apr 2017 10:11:44 -0700 Subject: [PATCH] HDFS-11625. Ozone: Fix UT failures that caused by hard coded datanode data dirs. Contributed by Weiwei Yang. --- .../test/java/org/apache/hadoop/cblock/TestCBlockCLI.java | 8 +++++--- .../ozone/container/common/TestDatanodeStateMachine.java | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/cblock/TestCBlockCLI.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/cblock/TestCBlockCLI.java index b869759533..46e1f6462e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/cblock/TestCBlockCLI.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/cblock/TestCBlockCLI.java @@ -62,9 +62,11 @@ public static void setup() throws IOException { @AfterClass public static void clean() { - cBlockManager.stop(); - cBlockManager.join(); - cBlockManager.clean(); + if (cBlockManager != null) { + cBlockManager.stop(); + cBlockManager.join(); + cBlockManager.clean(); + } } @After diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/TestDatanodeStateMachine.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/TestDatanodeStateMachine.java index e8a1edc64c..c9bd32ab1e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/TestDatanodeStateMachine.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/TestDatanodeStateMachine.java @@ -303,7 +303,6 @@ public void testDatanodeStateMachineWithInvalidSCMNames() for (String name : new String[] { "", // Empty "x..y", // Invalid schema - "scm:", // Missing port "scm:xyz", // Invalid port "scm:123456" // Port out of range }) {