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

Contract test for renaming over existing file is too lenient

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.1
    • Component/s: 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

            • Assignee:
              adoroszlai Attila Doroszlai
              Reporter:
              adoroszlai Attila Doroszlai

              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

                  Issue deployment