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

Sunil G commented on YARN-4947:
-------------------------------

Thanks [~bibinchundatt] for the patch and thanks [~rohithsharma] for the 
suggestions.

Few comments:

1. 
 addRMNode(int memory, NodeId nodeId) -->  addRMNode(NodeId nodeId, int 
memory). Its looks better this way for readability.
2. Few nits in below method:
{code}
private RMNodeImpl addRMNode(int memory, NodeId nodeId) {
            Resource capability = Resource.newInstance(memory, 4);
            Node node2 = RackResolver.resolve(nodeId.getHost());
            int port = nodeId.getPort();
            RMNodeImpl nodeImpl =
                new RMNodeImpl(nodeId, rm.getRMContext(), nodeId.getHost(), 
port, port,
                    node2, capability, YarnVersionInfo.getVersion());
            rm.getRMContext().getRMNodes().put(nodeId, nodeImpl);
            return nodeImpl;
          }
{code}
- Rename {{addRMNode}} to {{getNewRMNode}}
- Can remove local variable like {{node2}} , {{capability}} etc. It can be 
directly used. I dont think there is much complexity to convert these two to 
local variable.
- Do you feel whether we can send +1 to {{port}} for httpPort?


3. {{addStartedNode}} can be {{getRunningRMNode}}. These naming conventions 
were already used in {{TestRMNodeTransitions}}.
4. in {{testNodesHelper}}
{code}
374         RMNode rmnode1 = addStartedNode("h1", 1234, 5120);
375         NodeId nodeId2 = NodeId.newInstance("h2", 1235);
376         RMNodeImpl rmnode2 = addRMNode(5121, nodeId2);
377         sendStartedEvent(nodeId2, rmnode2);
{code}

I think both nodes has to be RUNNING, so why can't we use {{addStartedNode}} 
for second node  too directly?

5. In {{testSingleNodeQueryStateLost}}, earlier {{node1}} was moved to Lost. 
But in new change, its still RUNNING. Any change in test case behavior?


> Test timeout is happening for TestRMWebServicesNodes
> ----------------------------------------------------
>
>                 Key: YARN-4947
>                 URL: https://issues.apache.org/jira/browse/YARN-4947
>             Project: Hadoop YARN
>          Issue Type: Test
>          Components: test
>            Reporter: Bibin A Chundatt
>            Assignee: Bibin A Chundatt
>         Attachments: 0001-YARN-4947.patch, 0002-YARN-4947.patch, 
> 0003-YARN-4947.patch, 0004-YARN-4947.patch, 0005-YARN-4947.patch
>
>
> Testcase timeout for TestRMWebServicesNodes is happening after YARN-4893 
> [timeout|https://builds.apache.org/job/PreCommit-YARN-Build/11044/testReport/]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to