From a0e4ae55f2d0f64c1e869213513af5e22bab07b0 Mon Sep 17 00:00:00 2001 From: Aaron Myers Date: Tue, 14 Feb 2012 08:43:58 +0000 Subject: [PATCH] HDFS-2942. TestActiveStandbyElectorRealZK fails if build dir does not exist. Contributed by Aaron T. Myers. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-1623@1243827 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/hadoop/ha/TestActiveStandbyElectorRealZK.java | 8 ++++++++ hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt | 2 ++ 2 files changed, 10 insertions(+) diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestActiveStandbyElectorRealZK.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestActiveStandbyElectorRealZK.java index 85a5f8b682c..672e8d30d1e 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestActiveStandbyElectorRealZK.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestActiveStandbyElectorRealZK.java @@ -18,6 +18,7 @@ package org.apache.hadoop.ha; +import java.io.File; import java.io.IOException; import java.util.List; @@ -39,6 +40,13 @@ public class TestActiveStandbyElectorRealZK extends ClientBase { static final int NUM_ELECTORS = 2; static ZooKeeper[] zkClient = new ZooKeeper[NUM_ELECTORS]; static int currentClientIndex = 0; + + @Override + public void setUp() throws Exception { + // build.test.dir is used by zookeeper + new File(System.getProperty("build.test.dir", "build")).mkdirs(); + super.setUp(); + } class ActiveStandbyElectorTesterRealZK extends ActiveStandbyElector { ActiveStandbyElectorTesterRealZK(String hostPort, int timeout, diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt index 523c3c81684..2eac773f966 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt @@ -198,3 +198,5 @@ HDFS-2917. HA: haadmin should not work if run by regular user (eli) HDFS-2939. TestHAStateTransitions fails on Windows. (Uma Maheswara Rao G via atm) HDFS-2947. On startup NN throws an NPE in the metrics system. (atm) + +HDFS-2942. TestActiveStandbyElectorRealZK fails if build dir does not exist. (atm)