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

Misplaced assertion for the test case 'FLELostMessageTest' and not identifying misfunctions

    Details

    • Type: Test
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4.0
    • Fix Version/s: 3.5.0
    • Component/s: leaderElection
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Assertion for testLostMessage is kept inside the thread.run() method. Due to this the assertion failure will not be reflected in the main testcase.
      I have observed the test case is still passing in case of the assert failure or misfunction. Instead, the assertion can be moved to the test case - testLostMessage.

      class LEThread extends Thread {
                public void run(){
                      peer.setCurrentVote(v);
                      LOG.info("Finished election: " + i + ", " + v.getId());
                      Assert.assertTrue("State is not leading.", peer.getPeerState() == ServerState.LEADING);
                   } 
      

        Attachments

        1. ZOOKEEPER-1328.1.patch
          2 kB
          Rakesh R
        2. ZOOKEEPER-1328.2.patch
          3 kB
          Rakesh R
        3. ZOOKEEPER-1328.patch
          2 kB
          Rakesh R

          Activity

            People

            • Assignee:
              rakeshr Rakesh R
              Reporter:
              rakeshr Rakesh R
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: