This is an automated email from the ASF dual-hosted git repository.

bodewig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ant.git

commit 8dfa700a09e3520e33c2bdea267753d2dbd20c1d
Author: Stefan Bodewig <[email protected]>
AuthorDate: Sun Feb 8 11:38:36 2026 +0100

    make AntUnit test tearDown more reliable
---
 src/tests/antunit/antunit-base.xml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/tests/antunit/antunit-base.xml 
b/src/tests/antunit/antunit-base.xml
index ec7ec745d..28fc2c6d9 100644
--- a/src/tests/antunit/antunit-base.xml
+++ b/src/tests/antunit/antunit-base.xml
@@ -44,14 +44,20 @@
       Windows doesn't allow deleting read-only files, so we reset
       the permissions on those files to writable before tearDown
       can delete the input/output directory.
+
+      actOnLinkTargets is set to false as some tests leave dangling
+      links behind leading to errors at least on Windows.
     -->
-    <setpermissions mode="666" nonPosixMode="tryDosOrFail">
+    <setpermissions mode="666" nonPosixMode="tryDosOrFail" 
actOnLinkTargets="false">
       <fileset dir="${input}" erroronmissingdir="false"/>
       <fileset dir="${output}" erroronmissingdir="false"/>
     </setpermissions>
   </target>
 
   <target name="tearDown" depends="markFilesWritable">
+    <delete dir="${input}" followSymlinks="false" 
removeNotFollowedSymlinks="true"/>
+    <delete dir="${output}" followSymlinks="false" 
removeNotFollowedSymlinks="true"/>
+    <delete dir="${resources}" followSymlinks="false" 
removeNotFollowedSymlinks="true"/>
     <delete dir="${input}"/>
     <delete dir="${output}"/>
     <delete dir="${resources}"/>

Reply via email to