Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-8607

TestFileCorruption doesn't work as expected

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.0
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: test
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Although it passes, it's useless.

       77  File[] blocks = data_dir.listFiles();
       78  assertTrue("Blocks do not exist in data-dir", (blocks != null) && (blocks.length > 0));
       79  for (int idx = 0; idx < blocks.length; idx++) {
       80    if (!blocks[idx].getName().startsWith(Block.BLOCK_FILE_PREFIX)) {
       81      continue;
       82    }
       83    System.out.println("Deliberately removing file "+blocks[idx].getName());
       84    assertTrue("Cannot remove file.", blocks[idx].delete());
       85  }
      

      blocks are located at finalized/subdir0/subdir0, but line 77 only returns "subdir0" because File.listFiles() is not recursive. So line 83~84 will never be excuted.

        Attachments

          Activity

            People

            • Assignee:
              walter.k.su Walter Su
              Reporter:
              walter.k.su Walter Su
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: