Fix TestErasureCodingPolicyWithSnapshot.
Change-Id: I8169990a55f8aaa4429cede4d571ad0e3f489a0d
This commit is contained in:
parent
d5adaac439
commit
52a0ca301b
|
@ -25,6 +25,7 @@ import java.io.IOException;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.fs.FsShell;
|
import org.apache.hadoop.fs.FsShell;
|
||||||
import org.apache.hadoop.fs.Path;
|
import org.apache.hadoop.fs.Path;
|
||||||
|
import org.apache.hadoop.fs.contract.ContractTestUtils;
|
||||||
import org.apache.hadoop.fs.permission.FsPermission;
|
import org.apache.hadoop.fs.permission.FsPermission;
|
||||||
import org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy;
|
import org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy;
|
||||||
import org.apache.hadoop.hdfs.protocol.HdfsConstants.SafeModeAction;
|
import org.apache.hadoop.hdfs.protocol.HdfsConstants.SafeModeAction;
|
||||||
|
@ -32,7 +33,6 @@ import org.apache.hadoop.hdfs.protocol.SystemErasureCodingPolicies;
|
||||||
import org.apache.hadoop.util.ToolRunner;
|
import org.apache.hadoop.util.ToolRunner;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.jupiter.api.AfterEach;
|
import org.junit.jupiter.api.AfterEach;
|
||||||
import org.junit.jupiter.api.Assertions;
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.rules.Timeout;
|
import org.junit.rules.Timeout;
|
||||||
|
@ -174,10 +174,9 @@ public class TestErasureCodingPolicyWithSnapshot {
|
||||||
cluster.restartNameNode(true);
|
cluster.restartNameNode(true);
|
||||||
|
|
||||||
ErasureCodingPolicy ecSnap1 = fs.getErasureCodingPolicy(snap1);
|
ErasureCodingPolicy ecSnap1 = fs.getErasureCodingPolicy(snap1);
|
||||||
assertEquals(ecPolicy,
|
assertEquals(ecPolicy, ecSnap1, "Got unexpected erasure coding policy");
|
||||||
ecSnap1, "Got unexpected erasure coding policy");
|
assertEquals(ecSnap.getSchema(), ecSnap1.getSchema(),
|
||||||
assertEquals(ecSnap.getSchema(),
|
"Got unexpected ecSchema");
|
||||||
ecSnap1.getSchema(), "Got unexpected ecSchema");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -225,14 +224,14 @@ public class TestErasureCodingPolicyWithSnapshot {
|
||||||
DFSTestUtil.createFile(fs, ecFile, len, (short) 1, 0xFEED);
|
DFSTestUtil.createFile(fs, ecFile, len, (short) 1, 0xFEED);
|
||||||
|
|
||||||
// Verify FileStatus for normal and EC files
|
// Verify FileStatus for normal and EC files
|
||||||
Assertions.assertNotErasureCoded(fs, normalFile);
|
ContractTestUtils.assertNotErasureCoded(fs, normalFile);
|
||||||
Assertions.assertErasureCoded(fs, ecFile);
|
ContractTestUtils.assertErasureCoded(fs, ecFile);
|
||||||
|
|
||||||
cluster.restartNameNode(true);
|
cluster.restartNameNode(true);
|
||||||
|
|
||||||
// Verify FileStatus for normal and EC files
|
// Verify FileStatus for normal and EC files
|
||||||
Assertions.assertNotErasureCoded(fs, normalFile);
|
ContractTestUtils.assertNotErasureCoded(fs, normalFile);
|
||||||
Assertions.assertErasureCoded(fs, ecFile);
|
ContractTestUtils.assertErasureCoded(fs, ecFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue