RFR: 7903596: jmh-java-benchmark-archetype generated benchmark fails at runtime - ERROR: Unable to find the resource: /META-INF/BenchmarkList

Jaikiran Pai jpai at openjdk.org
Thu Nov 30 16:17:11 UTC 2023


On Thu, 30 Nov 2023 06:43:21 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> Can I please get a review of this change which proposes to address the issue noted in https://bugs.openjdk.org/browse/CODETOOLS-7903596?
> 
> As noted in that issue, when a benchmark generated using Java 22 is run, at runtime it fails with:
> 
> 
> java -jar target/benchmarks.jar
> 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)
> 
> 
> This is due to annotation processors being disabled by default during compilation starting Java 22. The commit in this PR, explicitly enables the `org.openjdk.jmh.generators.BenchmarkProcessor` annotation processor to allow for it to generate the necessary benchmark resources.
> 
> I've tested this change locally, with Java 8, Java 21 as well as Java 22 and the newly generated benchmark is now functional on all these versions.

Hello Aleksey, thank you for that info. I've enabled the actions and the job is in progress. There are some Windows failures, but those don't appear related:


Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 177.957 sec <<< FAILURE! - in org.openjdk.jmh.it.profilers.WinPerfAsmProfilerTest
test(org.openjdk.jmh.it.profilers.WinPerfAsmProfilerTest)  Time elapsed: 177.832 sec  <<< ERROR!
java.lang.IllegalStateException: Profile does not contain the required frame: PrintAssembly processed: 7 total address lines.


There's a macos run going on in that run for a while now, I'll check it out tomorrow on how it goes.

-------------

PR Comment: https://git.openjdk.org/jmh/pull/125#issuecomment-1834084317


More information about the jmh-dev mailing list