[ https://issues.apache.org/jira/browse/ATLAS-2037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16151308#comment-16151308 ]
Ashutosh Mestry commented on ATLAS-2037: ---------------------------------------- 0.8-incubating commit: 31991ee46e6de438fb75dd6be85f033b16b98baa master commit: 6f9684b4fb0a1c96993df900305d0c45c9a4e32f The commit incorrectly has ATLAS-2033 in its message. > 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: trunk, 0.8.1-incubating > > 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 (v6.4.14#64029)