diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDistributedFileSystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDistributedFileSystem.java index d09ad0209c..a27ed78e0d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDistributedFileSystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDistributedFileSystem.java @@ -1926,10 +1926,12 @@ public void testEnableAndDisableErasureCodingPolicy() throws Exception { fs.addErasureCodingPolicies(policies); assertEquals(policyName, ErasureCodingPolicyManager.getInstance(). getByName(policyName).getName()); - fs.disableErasureCodingPolicy(policyName); fs.enableErasureCodingPolicy(policyName); assertEquals(policyName, ErasureCodingPolicyManager.getInstance(). - getByName(policyName).getName()); + getEnabledPolicyByName(policyName).getName()); + fs.disableErasureCodingPolicy(policyName); + assertNull(ErasureCodingPolicyManager.getInstance(). + getEnabledPolicyByName(policyName)); //test enable a policy that doesn't exist try {