Details
Description
Found many tests run failed in Windows due to using DataNodeTestUtils#injectDataDirFailure. One of the failure test:
java.io.IOException: Failed to rename D:\work-project\hadoop\hadoop-hdfs-project\hadoop-hdfs\target\test\data\dfs\data\data2 to D:\work-project\hadoop\hadoop-hdfs-project\hadoop-hdfs\target\test\data\dfs\data\data2.origin. at org.apache.hadoop.hdfs.server.datanode.DataNodeTestUtils.injectDataDirFailure(DataNodeTestUtils.java:156) at org.apache.hadoop.hdfs.server.blockmanagement.TestBlockStatsMXBean.testStorageTypeStatsWhenStorageFailed(TestBlockStatsMXBean.java:176)
The root cause of this is that the test method uses DataNodeTestUtils#injectDataDirFailure to injects disk failures but however missing the compare operation assumeNotWindows. Currently DataNodeTestUtils#injectDataDirFailure is not supported in Windows then the test fails.
It would be better to add assumeNotWindows into DataNodeTestUtils#injectDataDirFailure in case we forget to add this in test methods.
Attachments
Attachments
Issue Links
- relates to
-
HDFS-8309 Skip unit test using DataNodeTestUtils#injectDataDirFailure() on Windows
- Resolved