RFR: 7903989: Default to no error if existing, make parent directories as needed
Christian Stein
cstein at openjdk.org
Tue Apr 15 14:56:43 UTC 2025
On Tue, 15 Apr 2025 14:12:38 GMT, Iris Clark <iris at openjdk.org> wrote:
>> Prior this change, most usages of the `$(MKDIR)` variable in jtreg's self-tests had to add `-p` in order to not fail with an "error if existing, make parent directories as needed". Many usages are lacking the flag and in concurrent test scenarios, this leads to flaky tests.
>>
>> This PR appends `-p` to each expansion of `$(MKDIR)`. Hard-coded `-p` will be removed; stray/duplicate `-p` flag don't seem to be a problem for `mkdir`'s option parser. I didn't see any "-p specifed more than once" warnings.
>>
>> This PR also cleans up redundant `-f` and `-rf` arguments from `$(RM) ...` calls, as they are very close in nature and location of the `$(MKDIR)` calls, as `Defs.gmk` declares `RM` to expand with `-rf`.
>
> test/jdkOptsTest/JDKOptsTest.gmk line 38:
>
>> 36: -Xlint -Werror \
>> 37: -encoding ASCII $(TESTDIR)/jdkOptsTest/JDKOptsTest.java
>> 38: $(RM) -rf $(@:%.ok=%)/tmp
>
> `$(RM)` is already defined to include the `-rf`, so suggest you remove those options here
Good catch. I only searched for `$(RM) -f` patterns before. Searching for `$(RM) -rf` hit two locations, both addressed in https://github.com/openjdk/jtreg/pull/259/commits/167328701a7f253b0eadbfe638545063fb217e5e
-------------
PR Review Comment: https://git.openjdk.org/jtreg/pull/259#discussion_r2044800640
More information about the jtreg-dev
mailing list