HDFS-9599. TestDecommissioningStatus.testDecommissionStatus occasionally fails (Lin Yiqun via iwasakims)

(cherry picked from commit 154d2532cf)
This commit is contained in:
Masatake Iwasaki 2016-04-05 03:19:48 +09:00
parent 334beb337f
commit 97cda4077a
1 changed files with 6 additions and 6 deletions

View File

@ -57,8 +57,8 @@ import org.apache.hadoop.hdfs.server.datanode.DataNodeTestUtils;
import org.apache.hadoop.hdfs.tools.DFSAdmin; import org.apache.hadoop.hdfs.tools.DFSAdmin;
import org.apache.log4j.Level; import org.apache.log4j.Level;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.junit.AfterClass; import org.junit.After;
import org.junit.BeforeClass; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
/** /**
@ -78,8 +78,8 @@ public class TestDecommissioningStatus {
final ArrayList<String> decommissionedNodes = new ArrayList<String>(numDatanodes); final ArrayList<String> decommissionedNodes = new ArrayList<String>(numDatanodes);
@BeforeClass @Before
public static void setUp() throws Exception { public void setUp() throws Exception {
conf = new HdfsConfiguration(); conf = new HdfsConfiguration();
conf.setBoolean(DFSConfigKeys.DFS_NAMENODE_REPLICATION_CONSIDERLOAD_KEY, conf.setBoolean(DFSConfigKeys.DFS_NAMENODE_REPLICATION_CONSIDERLOAD_KEY,
false); false);
@ -113,8 +113,8 @@ public class TestDecommissioningStatus {
Logger.getLogger(DecommissionManager.class).setLevel(Level.DEBUG); Logger.getLogger(DecommissionManager.class).setLevel(Level.DEBUG);
} }
@AfterClass @After
public static void tearDown() throws Exception { public void tearDown() throws Exception {
if (localFileSys != null ) cleanupFile(localFileSys, dir); if (localFileSys != null ) cleanupFile(localFileSys, dir);
if(fileSys != null) fileSys.close(); if(fileSys != null) fileSys.close();
if(cluster != null) cluster.shutdown(); if(cluster != null) cluster.shutdown();