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

Tsuyoshi OZAWA commented on YARN-2454:
--------------------------------------

Thanks for your contribution, [~beckham007]. The fix itself looks good to me. 
How about adding tests to TestResources like this?

{code}
  @Test(timeout=1000)
  public void testCompareToWithUnboundedResource() {
    assertTrue(Resources.unbounded().compareTo(
            createResource(Integer.MAX_VALUE, Integer.MAX_VALUE)) == 0);
    assertTrue(Resources.unbounded().compareTo(
        createResource(Integer.MAX_VALUE, 0)) < 0);
    assertTrue(Resources.unbounded().compareTo(
        createResource(0, Integer.MAX_VALUE)) < 0);
  }

  @Test(timeout=1000)
  public void testCompareToWithNoneResource() {
    assertTrue(Resources.none().compareTo(createResource(0, 0)) == 0);
    assertTrue(Resources.none().compareTo(
        createResource(1, 0)) < 0);
    assertTrue(Resources.none().compareTo(
        createResource(0, 1)) < 0);
  }
{code}

> The function compareTo of variable UNBOUNDED in 
> org.apache.hadoop.yarn.util.resource.Resources is definited wrong.
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: YARN-2454
>                 URL: https://issues.apache.org/jira/browse/YARN-2454
>             Project: Hadoop YARN
>          Issue Type: Bug
>    Affects Versions: 2.4.0, 2.5.0, 2.4.1
>            Reporter: Xu Yang
>         Attachments: YARN-2454-patch.diff
>
>




--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to