Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.0.0-alpha1
-
None
-
Jenkins
-
Reviewed
Description
TestDistributedFileSystem.testLocatedFileStatusStorageIdsTypes occasionally fails with the following error:
https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/699/testReport/org.apache.hadoop.hdfs/TestDistributedFileSystem/testLocatedFileStatusStorageIdsTypes/
FAILED: org.apache.hadoop.hdfs.TestDistributedFileSystem.testLocatedFileStatusStorageIdsTypes Error Message: Unexpected num storage ids expected:<2> but was:<1> Stack Trace: java.lang.AssertionError: Unexpected num storage ids expected:<2> but was:<1> at org.junit.Assert.fail(Assert.java:88) at org.junit.Assert.failNotEquals(Assert.java:743) at org.junit.Assert.assertEquals(Assert.java:118) at org.junit.Assert.assertEquals(Assert.java:555) at org.apache.hadoop.hdfs.TestDistributedFileSystem.testLocatedFileStatusStorageIdsTypes(TestDistributedFileSystem.java:855)
It appears that this test failed due to race condition: it does not wait for the file replication to finish, before checking the file's status.
This flaky test can be fixed by using DFSTestUtil.waitForReplication()