On 2025-07-01, Jaikiran Pai wrote:

> I had a detailed look at these failures. The majority of them were due
> to the tearDown() in these tests no longer able to delete the test
> generated read-only files. That would then cause subsequent tests to
> fail because they weren't expecting a read-only file to be present. I
> fixed that issue through this commit into Ant's repo
> https://github.com/apache/ant/commit/54350f7e967f965169a07f65ec925b621cef231d.
>  It's
> a test-only fix and what it does is, on Windows, before doing the
> tearDown(), it (re)sets the permissions on these test generated files
> to "writable" and then does the delete. That way the tearDown() can
> delete the input/output directories generated by the tests.

> Once that was committed almost all tests started passing expect for a
> few in copy-test.xml and move-test.xml
> https://ci-builds.apache.org/job/Ant/job/Ant%20Master%20Windows%20(latest%20EA%20JDK)/77/#showFailuresLink.
>  Looking
> at those tests what they do is, they use the copy or move tasks with
> the "force=true" property. These tests fail because even with
> "force=true", the Copy/Move task can no longer delete (and then
> update) a pre-existing read-only file on Windows. This is a functional
> issue, i.e. it means that the copy/move tasks' force=true is no longer
> functional in this specific scenario on Windows. In order to address
> this change in behaviour, I pushed a commit to Ant's repo
> https://github.com/apache/ant/commit/fe3727ee48b5ff89f65de52dea91c1bc757e4705.
>  Like
> I note, this is a change in the production source of Ant in
> FileUtils.tryHardToDelete(). In this change, on Windows, the
> implementation now sets the file to writable if it was read-only and
> File.delete() had failed. It then retries the File.delete(). After
> this change, the remaining test failures on Windows disappear (against
> Java 25 EA).

I agree with both of your changes.

Many thanks

     Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org

Reply via email to