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

Jason Lowe commented on YARN-5389:
----------------------------------

Thanks for updating the patch!

Nit: The getNewReservation method is no longer useful since it's just a 
one-liner that callers can do directly.

Since we're cleaning up bad exception catching practices in the file, there are 
still some cases where we're needlessly suppressing exceptions:
{code}
     try {
        client.submitApplication(context);
      } catch (YarnException e) {
        Assert.fail("Exception is not expected.");
      } catch (IOException e) {
        Assert.fail("Exception is not expected.");
      }
{code}
{code}
    try {
      conf.setBoolean(YarnConfiguration.TIMELINE_SERVICE_CLIENT_BEST_EFFORT, 
true);
      client.serviceInit(conf);
      client.getTimelineDelegationToken();
    } catch (Exception e) {
      Assert.fail("Should not have thrown an exception");
    }
{code}
{code}
    try {
      sResponse = client.submitReservation(sRequest);
    } catch (Exception e) {
      Assert.fail(e.getMessage());
    }
{code}

and this needless wrapping:

{code}
    } catch (Exception ex) {
      throw new Exception(ex);
    }
{code}

Actually there's so enough cleanup in this file that it may be better to do the 
minimal exception changes to fix testReservationDelete's handling of exceptions 
and get this unit test failure fixed, then we can tackle cleaning up the 
exception handling of the other test methods in this file in another JIRA.

> TestYarnClient#testReservationDelete fails in trunk
> ---------------------------------------------------
>
>                 Key: YARN-5389
>                 URL: https://issues.apache.org/jira/browse/YARN-5389
>             Project: Hadoop YARN
>          Issue Type: Test
>            Reporter: Rohith Sharma K S
>            Assignee: Sean Po
>              Labels: test
>         Attachments: YARN-5389.v1.patch, YARN-5389.v2.patch, 
> YARN-5389.v3.patch
>
>
> In build report 
> [report|https://builds.apache.org/job/PreCommit-YARN-Build/12341/artifact/patchprocess/patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-client.txt],
>  below test fails. 
> {noformat}
> Tests run: 28, Failures: 3, Errors: 0, Skipped: 0, Time elapsed: 26.066 sec 
> <<< FAILURE! - in org.apache.hadoop.yarn.client.api.impl.TestYarnClient
> testReservationDelete(org.apache.hadoop.yarn.client.api.impl.TestYarnClient)  
> Time elapsed: 2.213 sec  <<< FAILURE!
> java.lang.AssertionError: Exhausted attempts in checking if node capacity was 
> added to the plan
>       at org.junit.Assert.fail(Assert.java:88)
>       at 
> org.apache.hadoop.yarn.client.api.impl.TestYarnClient.setupMiniYARNCluster(TestYarnClient.java:1222)
>       at 
> org.apache.hadoop.yarn.client.api.impl.TestYarnClient.testReservationDelete(TestYarnClient.java:1584)
> testListReservationsByInvalidTimeInterval(org.apache.hadoop.yarn.client.api.impl.TestYarnClient)
>   Time elapsed: 2.215 sec  <<< FAILURE!
> java.lang.AssertionError: Exhausted attempts in checking if node capacity was 
> added to the plan
>       at org.junit.Assert.fail(Assert.java:88)
>       at 
> org.apache.hadoop.yarn.client.api.impl.TestYarnClient.setupMiniYARNCluster(TestYarnClient.java:1222)
>       at 
> org.apache.hadoop.yarn.client.api.impl.TestYarnClient.testListReservationsByInvalidTimeInterval(TestYarnClient.java:1444)
> testListReservationsByTimeIntervalContainingNoReservations(org.apache.hadoop.yarn.client.api.impl.TestYarnClient)
>   Time elapsed: 2.206 sec  <<< FAILURE!
> java.lang.AssertionError: Exhausted attempts in checking if node capacity was 
> added to the plan
>       at org.junit.Assert.fail(Assert.java:88)
>       at 
> org.apache.hadoop.yarn.client.api.impl.TestYarnClient.setupMiniYARNCluster(TestYarnClient.java:1222)
>       at 
> org.apache.hadoop.yarn.client.api.impl.TestYarnClient.testListReservationsByTimeIntervalContainingNoReservations(TestYarnClient.java:1494)
> {noformat}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to