HDFS-15461. TestDFSClientRetries testGetFileChecksum fails (#2404)
Co-authored-by: ahussein <ahmed.hussein@verizonmedia.com>
(cherry picked from commit afaab3d332
)
This commit is contained in:
parent
af5f90623c
commit
1429c65533
|
@ -839,14 +839,18 @@ public class TestDFSClientRetries {
|
||||||
public void testGetFileChecksum() throws Exception {
|
public void testGetFileChecksum() throws Exception {
|
||||||
final String f = "/testGetFileChecksum";
|
final String f = "/testGetFileChecksum";
|
||||||
final Path p = new Path(f);
|
final Path p = new Path(f);
|
||||||
|
// HDFS-15461: the number of datanode is higher than the number of replicas.
|
||||||
final MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(3).build();
|
// That way when a DN fails, the pipeline can recover.
|
||||||
|
final int numReplicas = 3;
|
||||||
|
final int numDatanodes = numReplicas + 1;
|
||||||
|
final MiniDFSCluster cluster =
|
||||||
|
new MiniDFSCluster.Builder(conf).numDataNodes(numDatanodes).build();
|
||||||
try {
|
try {
|
||||||
cluster.waitActive();
|
cluster.waitActive();
|
||||||
|
|
||||||
//create a file
|
// create a file
|
||||||
final FileSystem fs = cluster.getFileSystem();
|
final FileSystem fs = cluster.getFileSystem();
|
||||||
DFSTestUtil.createFile(fs, p, 1L << 20, (short)3, 20100402L);
|
DFSTestUtil.createFile(fs, p, 1L << 20, (short) numReplicas, 20100402L);
|
||||||
|
|
||||||
//get checksum
|
//get checksum
|
||||||
final FileChecksum cs1 = fs.getFileChecksum(p);
|
final FileChecksum cs1 = fs.getFileChecksum(p);
|
||||||
|
|
Loading…
Reference in New Issue