You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by "Madhan Neethiraj (JIRA)" <ji...@apache.org> on 2018/05/17 04:56:00 UTC

[jira] [Updated] (ATLAS-2037) Unit Test Failure: NotificationHookConsumerTest.testConsumersAreStoppedWhenInstanceBecomesPassive

     [ https://issues.apache.org/jira/browse/ATLAS-2037?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Madhan Neethiraj updated ATLAS-2037:
------------------------------------
    Fix Version/s:     (was: trunk)

> Unit Test Failure: NotificationHookConsumerTest.testConsumersAreStoppedWhenInstanceBecomesPassive
> -------------------------------------------------------------------------------------------------
>
>                 Key: ATLAS-2037
>                 URL: https://issues.apache.org/jira/browse/ATLAS-2037
>             Project: Atlas
>          Issue Type: Bug
>          Components:  atlas-core
>    Affects Versions: trunk
>            Reporter: Ashutosh Mestry
>            Assignee: Ashutosh Mestry
>            Priority: Minor
>             Fix For: 0.8.1
>
>         Attachments: ATLAS-2037-HookConsumer.patch
>
>
> *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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)