Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-9227

FileSystemContractBaseTest doesn't test filesystem's mkdir/isDirectory() logic rigorously enough

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-alpha1
    • Fix Version/s: 2.1.0-beta
    • Component/s: fs
    • Labels:
      None

      Description

      The FileSystemContractBaseTest.mkdirs() asserts that a newly created directory is true, but way of FileStatus.isFile(), but doesn't assert that the directory is a dir by way of FileStatus.isDir().

      The assertion used is slightly weaker, as the isFile() test is actually
      !isdir && !isSymlink(). if an implementation of FileSystem.mkdirs() created symlinks then the test would still pass.

      There is one test that looks at the isDirectory() logic, testMkdirsWithUmask() -but as that test is skipped for the s3 filesystems, it is possible for those filesystems (or similar) to not have their directory creation logic stressed enough.

      The fix would be a trivial single line.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                stevel@apache.org Steve Loughran
                Reporter:
                stevel@apache.org Steve Loughran
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: