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

Jason Lowe commented on YARN-6536:
----------------------------------

This is the assertion that is failing:
{code}
    assertEquals(2, amClient.release.size());
{code}

The problem is that the code above is doing this:
{code}
    while (allocatedContainerCount < containersRequestedAny
        && iterationsLeft-- > 0) {
      AllocateResponse allocResponse = amClient.allocate(0.1f);
      assertEquals(0, amClient.ask.size());
      assertEquals(0, amClient.release.size());
      
      assertEquals(nodeCount, amClient.getClusterNodeCount());
      allocatedContainerCount += allocResponse.getAllocatedContainers().size();
      for(Container container : allocResponse.getAllocatedContainers()) {
        ContainerId rejectContainerId = container.getId();
        releases.add(rejectContainerId);
        amClient.releaseAssignedContainer(rejectContainerId);
      }
[...]
{code}

If it takes more than one iteration to get two containers allocated then 
amClient.release will be 1 instead of 2 and the test will fail.  Part of the 
problem here is that it's using a full-blown minicluster and doing hacky 
100msec sleeps in hopes that the node heartbeats in the interim.  Having the 
test wield something like a MockRM and MockNM that it can explicitly control 
the heartbeats relative to allocate calls would make this test more 
deterministic (and faster).

Minimally the test should be checking {{releases.size()}} to see if all of the 
containers were released across the iterations rather than 
{{amClient.release.size()}}.

> TestAMRMClient.testAMRMClientWithSaslEncryption fails intermittently
> --------------------------------------------------------------------
>
>                 Key: YARN-6536
>                 URL: https://issues.apache.org/jira/browse/YARN-6536
>             Project: Hadoop YARN
>          Issue Type: Bug
>    Affects Versions: 2.8.1
>            Reporter: Eric Badger
>
> {noformat}
> java.lang.AssertionError: expected:<2> but was:<1>
>       at org.junit.Assert.fail(Assert.java:88)
>       at org.junit.Assert.failNotEquals(Assert.java:743)
>       at org.junit.Assert.assertEquals(Assert.java:118)
>       at org.junit.Assert.assertEquals(Assert.java:555)
>       at org.junit.Assert.assertEquals(Assert.java:542)
>       at 
> org.apache.hadoop.yarn.client.api.impl.TestAMRMClient.testAllocation(TestAMRMClient.java:1005)
>       at 
> org.apache.hadoop.yarn.client.api.impl.TestAMRMClient.registerAndAllocate(TestAMRMClient.java:703)
>       at 
> org.apache.hadoop.yarn.client.api.impl.TestAMRMClient.testAMRMClientWithSaslEncryption(TestAMRMClient.java:675)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to