Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-1104

CLONE - In QuorumTest, use the same "for ( .. try { break } catch { } )" pattern in testFollowersStartAfterLeaders as in testSessionMove.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.4.0
    • 3.4.0
    • tests
    • None
    • Reviewed
    • Contains improvement to original patch (remove unneeded boolean variable).

    Description

      Patrick Hunt writes:

      "Such uses of sleep [used in testFollowersStartAfterLeader] are just asking for trouble. Take a look at the use
      of sleep in testSessionMove in the same class for a better way to do
      this. I had gone through all the tests a while back, replacing all the
      "sleep" with something like this testSessionMove pattern (retry
      with a max limit that's very long). During reviews we should look for
      anti-patterns like this and address them before commit."

      So, modify testFollowersStartAfterLeaders to use the same retrying approach that testSessionMove uses.

      Attachments

        1. ZOOKEEPER-1104.patch
          1 kB
          Eugene Joseph Koontz
        2. ASF.LICENSE.NOT.GRANTED--ZOOKEEPER-1103.patch
          1 kB
          sreekanth
        3. ASF.LICENSE.NOT.GRANTED--ZOOKEEPER-1103_branch_3_3.patch
          1 kB
          sreekanth

        Issue Links

          Activity

            People

              ekoontz Eugene Joseph Koontz
              sreekanth.bat sreekanth
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: