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

Mingliang Liu commented on HDFS-10281:
--------------------------------------

Basically, there is a fixed interval sleep in the test during which the test 
waits for the DN registration (again) along with a different uuid. The test 
asserts there is always a registered DN, which is not true while the DN is 
restarting.

A simple fix would be remove the statement asserting the non-empty 
{{datanodesMap}}:
{code}
- assertEquals(1, registeredDatanodes.size());
{code}

A better solution is to wait for the condition (the DN registers with a 
different uuid) using GenericTestUtils.waitFor.

> o.a.h.hdfs.server.namenode.ha.TestPendingCorruptDnMessages fails 
> intermittently
> -------------------------------------------------------------------------------
>
>                 Key: HDFS-10281
>                 URL: https://issues.apache.org/jira/browse/HDFS-10281
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 2.8.0
>            Reporter: Mingliang Liu
>            Assignee: Mingliang Liu
>
> In our daily UT test, we found the 
> {{TestPendingCorruptDnMessages#testChangedStorageId}} failed intermittently, 
> see following information:
> *Error Message*
> expected:<1> but was:<0>
> *Stacktrace*
> {code}
> 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.hdfs.server.namenode.ha.TestPendingCorruptDnMessages.getRegisteredDatanodeUid(TestPendingCorruptDnMessages.java:124)
>       at 
> org.apache.hadoop.hdfs.server.namenode.ha.TestPendingCorruptDnMessages.testChangedStorageId(TestPendingCorruptDnMessages.java:103)
> {code}



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

Reply via email to