[ https://issues.apache.org/jira/browse/HDFS-9493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15056768#comment-15056768 ]
Tony Wu commented on HDFS-9493: ------------------------------- Hi [~liuml07], Thanks for your detailed comments. I have confirmed problem 2 & 3 after revisiting the test code. For problem 3, I mis-read the {{@BeforeClass}} and {{@AfterClass}} tags, thinking {{MiniDFSCluster}} will be torn down and rebuilt for every test. That is not the case here. Instead as you said by the time {{testMetaSave()}} runs {{testMetaSaveAfterDelete()}} would have already removed the DN and the {{cluster.stopDataNode()}} call in the second test is essentially a no-op. Looks like the tests just happened to be working. The {{setup}} and {{tearDown}} functions should have been executed before and after each test case. For problem 1 and 2, to further reduce the wait time for this unit test, {{BlockManagerTestUtil#noticeDeadDatanode()}} will be useful. This helper function will set the DN to be dead right away instead of waiting for HB timeout. I will rework the current patch and incorporate the findings above. > Test o.a.h.hdfs.server.namenode.TestMetaSave fails in trunk > ----------------------------------------------------------- > > Key: HDFS-9493 > URL: https://issues.apache.org/jira/browse/HDFS-9493 > Project: Hadoop HDFS > Issue Type: Bug > Components: test > Reporter: Mingliang Liu > Assignee: Tony Wu > Attachments: HDFS-9493.001.patch > > > Tested in both Gentoo Linux and Mac. > {quote} > ------------------------------------------------------- > T E S T S > ------------------------------------------------------- > Running org.apache.hadoop.hdfs.server.namenode.TestMetaSave > Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 34.159 sec > <<< FAILURE! - in org.apache.hadoop.hdfs.server.namenode.TestMetaSave > testMetasaveAfterDelete(org.apache.hadoop.hdfs.server.namenode.TestMetaSave) > Time elapsed: 15.318 sec <<< FAILURE! > java.lang.AssertionError: null > at org.junit.Assert.fail(Assert.java:86) > at org.junit.Assert.assertTrue(Assert.java:41) > at org.junit.Assert.assertTrue(Assert.java:52) > at > org.apache.hadoop.hdfs.server.namenode.TestMetaSave.testMetasaveAfterDelete(TestMetaSave.java:154) > {quote} -- This message was sent by Atlassian JIRA (v6.3.4#6332)