[
https://issues.apache.org/jira/browse/HDFS-6160?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Arpit Agarwal updated HDFS-6160:
--------------------------------
Attachment: HDFS-6160.01.patch
Fix a couple of race conditions with the test case:
# The {{waitFor}} predicate was just checking that _safeModeBlocks > 0_ which
can happen before block reports from all storages attached to the DN are
processed. If the subsequent block reports come after this check and before we
sample {{getSafeModeSafeBlocks}}, then {{safe}} will be wrong. Fixed it by
adding a metric for storageBlockReportOps and checking it.
# Put the check for {{getUnderReplicatedBlocks}} in a loop since the processing
is asynch and may be delayed.
> TestSafeMode occasionally fails
> -------------------------------
>
> Key: HDFS-6160
> URL: https://issues.apache.org/jira/browse/HDFS-6160
> Project: Hadoop HDFS
> Issue Type: Test
> Reporter: Ted Yu
> Priority: Minor
> Attachments: HDFS-6160.01.patch
>
>
> From
> https://builds.apache.org/job/PreCommit-HDFS-Build/6511//testReport/org.apache.hadoop.hdfs/TestSafeMode/testInitializeReplQueuesEarly/
> :
> {code}
> java.lang.AssertionError: expected:<13> but was:<0>
> at org.junit.Assert.fail(Assert.java:93)
> at org.junit.Assert.failNotEquals(Assert.java:647)
> at org.junit.Assert.assertEquals(Assert.java:128)
> at org.junit.Assert.assertEquals(Assert.java:472)
> at org.junit.Assert.assertEquals(Assert.java:456)
> at
> org.apache.hadoop.hdfs.TestSafeMode.testInitializeReplQueuesEarly(TestSafeMode.java:212)
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)