Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-10666 Über-jira: Unit tests should not use fixed sleep interval to wait for conditions
  3. HDFS-10985

o.a.h.ha.TestZKFailoverController should not use fixed time sleep before assertions

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.8.0, 3.0.0-alpha2
    • ha, test
    • None
    • Reviewed

    Description

      TestZKFailoverController#testGracefulFailoverMultipleZKfcs uses fixed time sleep before assertions. This may fail sometimes though 10 seconds are generally long enough. I think we can use GenericTestUtils.waitFor() to retry the assertions. Meanwhile, it usually does not need 10 seconds to reach the condition (<1s in my laptop). Removing the 10s sleep will also make the UT run faster.

      This is also true to TestZKFailoverController#testGracefulFailover.

      Attachments

        1. HDFS-10985-branch-2.8.001.patch
          2 kB
          Mingliang Liu
        2. HDFS-10985.001.patch
          3 kB
          Mingliang Liu
        3. HDFS-10985.000.patch
          2 kB
          Mingliang Liu

        Activity

          People

            liuml07 Mingliang Liu
            liuml07 Mingliang Liu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: