Skip to content

HADOOP-19826. Add contract test to verify renaming empty dir works.#8304

Merged
steveloughran merged 1 commit intoapache:trunkfrom
deepujain:HADOOP-19826-contract-test-rename-empty-dir
Mar 9, 2026
Merged

HADOOP-19826. Add contract test to verify renaming empty dir works.#8304
steveloughran merged 1 commit intoapache:trunkfrom
deepujain:HADOOP-19826-contract-test-rename-empty-dir

Conversation

@deepujain
Copy link
Contributor

HADOOP-19826. Add contract test to verify renaming empty dir works

Summary

Adds a contract test testRenameEmptyDir in AbstractContractRenameTest that verifies filesystems correctly support renaming an empty directory to a new path: create an empty directory, rename it to a new path, assert rename returns true and the directory exists at the destination and no longer at the source.

Change

  • File: hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractRenameTest.java
  • New test method testRenameEmptyDir(): creates an empty dir under testRenameEmptyDir/src, renames it to testRenameEmptyDir/dest, asserts rename() returns true, destination is a directory, and source path does not exist.

JIRA

Fixes HADOOP-19826

Add testRenameEmptyDir in AbstractContractRenameTest.
@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 6m 53s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 26m 53s trunk passed
+1 💚 compile 8m 23s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 compile 8m 41s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 checkstyle 0m 50s trunk passed
+1 💚 mvnsite 1m 0s trunk passed
+1 💚 javadoc 0m 45s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 0m 48s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 1m 39s trunk passed
+1 💚 shadedclient 16m 7s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 39s the patch passed
+1 💚 compile 8m 3s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javac 8m 3s the patch passed
+1 💚 compile 8m 34s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 javac 8m 34s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 45s the patch passed
+1 💚 mvnsite 1m 2s the patch passed
+1 💚 javadoc 0m 44s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 0m 45s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 1m 41s the patch passed
+1 💚 shadedclient 16m 24s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 17m 2s hadoop-common in the patch passed.
+1 💚 asflicense 0m 39s The patch does not generate ASF License warnings.
129m 32s
Subsystem Report/Notes
Docker ClientAPI=1.54 ServerAPI=1.54 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8304/1/artifact/out/Dockerfile
GITHUB PR #8304
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux bd860e7103f1 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 57b33a8
Default Java Ubuntu-17.0.18+8-Ubuntu-124.04.1
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.10+7-Ubuntu-124.04 /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.18+8-Ubuntu-124.04.1
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8304/1/testReport/
Max. process+thread count 1276 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8304/1/console
versions git=2.43.0 maven=3.9.11 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

@steveloughran
Copy link
Contributor

I see my PR of #8283 has been approved already, so I could just merge that, but as your's actually adds more assertions it's the better one of the two.

+1

@steveloughran steveloughran merged commit 0da2d8c into apache:trunk Mar 9, 2026
4 checks passed
@steveloughran
Copy link
Contributor

@deepujain merged this to trunk.

what is your JIRA username for credit there?

steveloughran pushed a commit that referenced this pull request Mar 9, 2026
…8304)

Add testRenameEmptyDir in AbstractContractRenameTest.

Contributed by Deepak Jain
@deepujain
Copy link
Contributor Author

@steveloughran JIRA id is deepujain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants