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

Contract test for renaming over existing file is too lenient

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.3.1
    • test

    Description

      AbstractContractRenameTest#testRenameFileOverExistingFile is too lenient in its assertions.

      • FileAlreadyExistsException is accepted regardless of "rename overwrites" and "rename returns false if exists" contract options. I think it should be accepted only if both of those options are false.
      • "rename returns false if exists" option is ignored if the file is not overwritten by the implementation.

      Also, I think the "rename returns false if exists" option is incorrectly inverted in the test, which it can get away with because the checks are loose.

      (Found this while looking at a change in Ozone FS implementation from throwing exception to returning false. The contract test unexpectedly passed without changing contract.xml.)

      Attachments

        Issue Links

          Activity

            People

              adoroszlai Attila Doroszlai
              adoroszlai Attila Doroszlai
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m