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

Mingliang Liu commented on HADOOP-13375:
----------------------------------------

Thanks for the patch, [~cheersyang]. And welcome to Hadoop contributors.

I think the retry of check makes sense here.
# Can we replace {{waitOnExpectedValue()}} with {{GenericTestUtils.waitFor()}}? 
See the Über-jira [HDFS-10666] for usages in other cases.
# Should we group the related assertions as a single wait-for condition? e.g.
{code}
626         assertEquals(groups.getBackgroundRefreshQueued(), 0);               
627         assertEquals(groups.getBackgroundRefreshRunning(), 0);              
628         assertEquals(groups.getBackgroundRefreshSuccess(), 5);
{code}
are actually multiple state variables of the same condition. This may make the 
code changes simpler.
{code}
GenericTestUtils.waitFor(...
  ...
   return groups.getBackgroundRefreshQueued() == 0 &&
          groups.getBackgroundRefreshRunning() == 0 &&
          groups.getBackgroundRefreshSuccess() == 5;
  ...
);
{code}


> o.a.h.security.TestGroupsCaching.testBackgroundRefreshCounters seems flaky
> --------------------------------------------------------------------------
>
>                 Key: HADOOP-13375
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13375
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: security, test
>    Affects Versions: 2.8.0
>            Reporter: Mingliang Liu
>            Assignee: Weiwei Yang
>         Attachments: HADOOP-13375.001.patch, HADOOP-13375.002.patch
>
>
> h5. Error Message
> bq. expected:<1> but was:<0>
> h5. Stacktrace
> {quote}
> java.lang.AssertionError: expected:<1> but was:<0>
>       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.security.TestGroupsCaching.testBackgroundRefreshCounters(TestGroupsCaching.java:638)
> {quote}



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