melix / jmh-gradle-plugin

Integrates the JMH benchmarking framework with Gradle
Apache License 2.0
659 stars 88 forks source link

Gradle `jmh` task still succeed when JMH fails. #255

Open robin-aws opened 12 months ago

robin-aws commented 12 months ago

Describe the bug See title.

To Reproduce Create a benchmark method that always throws an exception and ensure failOnError is true. The exception will print out and JMH will report failure, but Gradle will still report "BUILD SUCCESSFUL". (Working on setting up this repo locally and making a unit test to confirm).

Root cause is failing to check the exit code after spawning the process to call JMH: https://github.com/melix/jmh-gradle-plugin/blob/master/src/main/java/me/champeau/jmh/JMHTask.java#L70