[ https://issues.apache.org/jira/browse/YARN-763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13705556#comment-13705556 ]
Bikas Saha commented on YARN-763: --------------------------------- We can simply create another version of the TestCallbackHandler that calls asyncClient.stop() when asyncClient calls its getProgress() method. After the stop() has completed the method can set a flag and notifyAll(this). The main test thread can wait() on the handler object and check that the flag is set when it gets notified. Else it waits again. This way if the callback thread is deadlocked then test thread will not exit and the test will fail with timeout. To verify, the test should fail with join() and pass without it. Similar logic is used in other tests. Please lets not sleep(1000) as this just slows down the testing. Lets sleep(50) and set the heartbeat interval to 10. This allows for 5 heartbeats and so the verification that actual heartbeat count == 1 is accurate. > AMRMClientAsync should stop heartbeating after receiving shutdown from RM > ------------------------------------------------------------------------- > > Key: YARN-763 > URL: https://issues.apache.org/jira/browse/YARN-763 > Project: Hadoop YARN > Issue Type: Bug > Reporter: Bikas Saha > Assignee: Xuan Gong > Attachments: YARN-763.1.patch, YARN-763.2.patch, YARN-763.3.patch, > YARN-763.4.patch, YARN-763.5.patch, YARN-763.6.patch, YARN-763.7.patch > > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira