RFR: 8317802: jmh tests fail with Unable to find the resource: /META-INF/BenchmarkList after JDK-8306819 [v3]
Jaikiran Pai
jpai at openjdk.org
Wed Oct 11 01:00:15 UTC 2023
On Tue, 10 Oct 2023 17:09:51 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
>> Can I please get a review of this change which proposes to fix jmh test launch failures noted in https://bugs.openjdk.org/browse/JDK-8317802?
>>
>> jmh apparently relies on annotation processors during compilation of a benchmark. When annotation processing is disabled, the generated benchmark jar is unusable when the benchmark is launched and fails with:
>>
>>
>> Exception in thread "main" java.lang.RuntimeException: ERROR: Unable to find the resource: /META-INF/BenchmarkList
>> at org.openjdk.jmh.runner.AbstractResourceReader.getReaders(AbstractResourceReader.java:98)
>> at org.openjdk.jmh.runner.BenchmarkList.find(BenchmarkList.java:124)
>> at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:252)
>> at org.openjdk.jmh.runner.Runner.run(Runner.java:208)
>> at org.openjdk.jmh.Main.main(Main.java:71)
>>
>> After the integration of https://bugs.openjdk.org/browse/JDK-8306819 recently in JDK mainline, `javac` no longer runs annotation processors by default. These jmh tests that are compiled as part of the JDK build will now have to enable annotation processing explicitly.
>>
>> The commit in this PR enables annotation processing by setting `-proc:full` (implying run annotation processors as well as compile the files) when compiling the benchmarks.
>>
>> I tested this change locally. Without this change, the following command fails:
>>
>>
>> make test TEST="micro:java.lang.ArraysSort"
>> ...
>> Test selection 'micro:java.lang.ArraysSort', will run:
>> * micro:java.lang.ArraysSort
>>
>> Running test 'micro:java.lang.ArraysSort'
>> Exception in thread "main" java.lang.RuntimeException: ERROR: Unable to find the resource: /META-INF/BenchmarkList
>> at org.openjdk.jmh.runner.AbstractResourceReader.getReaders(AbstractResourceReader.java:98)
>> at org.openjdk.jmh.runner.BenchmarkList.find(BenchmarkList.java:124)
>> at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:252)
>> at org.openjdk.jmh.runner.Runner.run(Runner.java:208)
>> at org.openjdk.jmh.Main.main(Main.java:71)
>> Finished running test 'micro:java.lang.ArraysSort'
>>
>>
>>
>> After the change in this PR, the same command works fine and the jmh benchmark is run.
>
> Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision:
>
> Erik's suggestion - move param to new line
Hello Magnus,
> @jaikiran Was your intention that someone else should integrate this patch, and if so, who, and depending on what criteria?
It was too late for me yesterday here, so I didn't want to rush this in and cause any unexpected CI failures when I am not around. But since this was already reviewed and if any committer in their workday was blocked on this and wanted to integrate it (and of course watch for unexpected failures), then I thought it would be good for them to go ahead and integrate. If that didn't happen then I planned to integrate it my morning time (now).
Thank you Erik and Magnus for the reviews.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16122#issuecomment-1756545056
PR Comment: https://git.openjdk.org/jdk/pull/16122#issuecomment-1756546450
More information about the build-dev
mailing list