[ 
https://issues.apache.org/jira/browse/YARN-1069?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13742003#comment-13742003
 ] 

Maysam Yabandeh commented on YARN-1069:
---------------------------------------

One example I have in mind is sending NM update events to RM in 
NodeStatusUpdaterImpl#startStatusUpdater, where the heartbeat is sent 
periodically:
{code:java}
   statusUpdaterRunnable = new Runnable() {
      @Override
      @SuppressWarnings("unchecked")
      public void run() {
        int lastHeartBeatID = 0;
        while (!isStopped) {
          // Send heartbeat
{code}

We can simply wrap the functionality in a separate method and call the method 
inside the timer. The tester can then configure the MiniYarnCluster to directly 
call the exposed method instead of running the timer.
                
> Deterministic MiniYARNCluster
> -----------------------------
>
>                 Key: YARN-1069
>                 URL: https://issues.apache.org/jira/browse/YARN-1069
>             Project: Hadoop YARN
>          Issue Type: Test
>    Affects Versions: 2.1.0-beta
>            Reporter: Maysam Yabandeh
>            Assignee: Maysam Yabandeh
>            Priority: Minor
>
> Currently the order of events in MiniYarnCluster is nondeterministic as the 
> events are triggered by scheduled timers. This makes it difficult to write 
> tests since some erroneous scenarios are triggered only after some particular 
> sequence of events. An example is the bug in YARN-779 where without this 
> control over events, writing a deterministic unit test is not possible. We 
> should modify the source to allow both manual invocation of events as well as 
> via existing periodic timers. MiniYarnCluster can then expose such methods 
> for more control over events ordering.

--
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

Reply via email to