HDFS-6714. TestBlocksScheduledCounter#testBlocksScheduledCounter should shutdown cluster (vinayakumarb)
This commit is contained in:
parent
6104520369
commit
772d1fb01e
|
@ -697,6 +697,9 @@ Release 2.6.0 - UNRELEASED
|
||||||
|
|
||||||
HDFS-6905. fs-encryption merge triggered release audit failures. (clamb via tucu)
|
HDFS-6905. fs-encryption merge triggered release audit failures. (clamb via tucu)
|
||||||
|
|
||||||
|
HDFS-6714. TestBlocksScheduledCounter#testBlocksScheduledCounter should
|
||||||
|
shutdown cluster (vinayakumarb)
|
||||||
|
|
||||||
Release 2.5.1 - UNRELEASED
|
Release 2.5.1 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -27,6 +27,7 @@ import org.apache.hadoop.fs.FileSystem;
|
||||||
import org.apache.hadoop.fs.Path;
|
import org.apache.hadoop.fs.Path;
|
||||||
import org.apache.hadoop.hdfs.server.blockmanagement.DatanodeDescriptor;
|
import org.apache.hadoop.hdfs.server.blockmanagement.DatanodeDescriptor;
|
||||||
import org.apache.hadoop.hdfs.server.blockmanagement.DatanodeManager;
|
import org.apache.hadoop.hdfs.server.blockmanagement.DatanodeManager;
|
||||||
|
import org.junit.After;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,14 +36,25 @@ import org.junit.Test;
|
||||||
* scheduled to a datanode.
|
* scheduled to a datanode.
|
||||||
*/
|
*/
|
||||||
public class TestBlocksScheduledCounter {
|
public class TestBlocksScheduledCounter {
|
||||||
|
MiniDFSCluster cluster = null;
|
||||||
|
FileSystem fs = null;
|
||||||
|
|
||||||
|
@After
|
||||||
|
public void tearDown() throws IOException {
|
||||||
|
if (fs != null) {
|
||||||
|
fs.close();
|
||||||
|
}
|
||||||
|
if(cluster!=null){
|
||||||
|
cluster.shutdown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBlocksScheduledCounter() throws IOException {
|
public void testBlocksScheduledCounter() throws IOException {
|
||||||
MiniDFSCluster cluster = new MiniDFSCluster.Builder(new HdfsConfiguration())
|
cluster = new MiniDFSCluster.Builder(new HdfsConfiguration()).build();
|
||||||
.build();
|
|
||||||
|
|
||||||
cluster.waitActive();
|
cluster.waitActive();
|
||||||
FileSystem fs = cluster.getFileSystem();
|
fs = cluster.getFileSystem();
|
||||||
|
|
||||||
//open a file an write a few bytes:
|
//open a file an write a few bytes:
|
||||||
FSDataOutputStream out = fs.create(new Path("/testBlockScheduledCounter"));
|
FSDataOutputStream out = fs.create(new Path("/testBlockScheduledCounter"));
|
||||||
|
|
Loading…
Reference in New Issue