Uploaded image for project: 'Atlas'
  1. Atlas
  2. ATLAS-2037

Unit Test Failure: NotificationHookConsumerTest.testConsumersAreStoppedWhenInstanceBecomesPassive

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • trunk
    • 0.8.1
    • atlas-core
    • None

    Description

      Analysis

      • The test has few mocks, but we don’t mock HookConsumer (derived from ShutdownableThread). Hence, the object needs be in line with its usage pattern.
      • The ShutdownableThread has a CountdownLatch that is checked during shutdown.

      In the test, the HookConsumer was not being started at all. This caused shutdownLatch (of type CountdownLatch) not to decrement, since no work was performed, but anticipating work is going to be done. The test thus ended up not getting completed, since the thread was in perpetual wait.

      Solution
      The HookConsumer should be used such that it is started and shutdown. So the test passes.

      HookConsumer should check for shouldRun in shutdown method, so that the case where shutdown is called without start is handled.

      Attachments

        1. ATLAS-2037-HookConsumer.patch
          7 kB
          Ashutosh Mestry

        Activity

          People

            amestry Ashutosh Mestry
            amestry Ashutosh Mestry
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: