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

Kihwal Lee commented on HDFS-2434:
----------------------------------

The test case fails this way when the corrupt replica is fixed right away 
before gathering namenode metrics. In one example, 
computeReplicationWorkForBlocks() was done within 10ms of the block corruption 
and the datanode did heartbeat in 380ms. The block corruption was resolved 
completely in 13ms after that.  

Since replication monitor and dn heartbeats are asynchronous, the current way 
of sleeping for 1 sec is not a reliable way to hit a moment between the two.
                
> TestNameNodeMetrics.testCorruptBlock fails intermittently
> ---------------------------------------------------------
>
>                 Key: HDFS-2434
>                 URL: https://issues.apache.org/jira/browse/HDFS-2434
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: test
>            Reporter: Uma Maheswara Rao G
>
> java.lang.AssertionError: Bad value for metric CorruptBlocks expected:<1> but 
> was:<0>
>       at org.junit.Assert.fail(Assert.java:91)
>       at org.junit.Assert.failNotEquals(Assert.java:645)
>       at org.junit.Assert.assertEquals(Assert.java:126)
>       at org.junit.Assert.assertEquals(Assert.java:470)
>       at 
> org.apache.hadoop.test.MetricsAsserts.assertGauge(MetricsAsserts.java:185)
>       at 
> org.apache.hadoop.hdfs.server.namenode.metrics.TestNameNodeMetrics.__CLR3_0_2t8sh531i1k(TestNameNodeMetrics.java:175)
>       at 
> org.apache.hadoop.hdfs.server.namenode.metrics.TestNameNodeMetrics.testCorruptBlock(TestNameNodeMetrics.java:164)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:597)
>       at junit.framework.TestCase.runTest(TestCase.java:168)
>       at junit.framework.TestCase.runBare(TestCase.java:134)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to