Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-9565

TestDistributedFileSystem.testLocatedFileStatusStorageIdsTypes is flaky due to race condition

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.0.0-alpha1
    • 2.8.0, 3.0.0-alpha1
    • fs, test
    • 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()

      Attachments

        1. HDFS-9565.001.patch
          0.9 kB
          Wei-Chiu Chuang

        Activity

          People

            weichiu Wei-Chiu Chuang
            weichiu Wei-Chiu Chuang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: