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

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

    XMLWordPrintableJSON

Details

    • Test
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.5.0
    • leaderElection
    • None
    • 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 Radhakrishnan
        2. ZOOKEEPER-1328.2.patch
          3 kB
          Rakesh Radhakrishnan
        3. ZOOKEEPER-1328.patch
          2 kB
          Rakesh Radhakrishnan

        Activity

          People

            rakeshr Rakesh Radhakrishnan
            rakeshr Rakesh Radhakrishnan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: