How do I shut everything down?

Bruce Eckel bruceteckel at gmail.com
Tue Oct 25 16:02:07 UTC 2016


This is my gradle jmh section:

    jmh {
        jmhVersion = '1.15'
        duplicateClassesStrategy = 'warn'
        failOnError = true
        // See https://github.com/melix/jmh-gradle-plugin
        // for other options
    }


However, that doesn't seem to have any effect: exceptions are reported as
before but JMH just continues, as it did without the failOnError = true.


-- Bruce Eckel
www.MindviewInc.com <http://www.mindviewinc.com/>
Blog: BruceEckel.github.io
www.WinterTechForum.com
www.AtomicScala.com
www.Reinventing-Business.com
http://www.TrustOrganizations.com <http://www.ScalaSummit.com>


On Mon, Oct 24, 2016 at 3:23 AM, Aleksey Shipilev <shade at redhat.com> wrote:

> On 10/22/2016 08:59 PM, Bruce Eckel wrote:
> > If I call System.exit(), it prints a message about early JVM shutdown but
> > then keeps going. Is there a call I can make to terminate everything? I'd
> > like to be able to report a runtime error and then quit so it doesn't
> > scroll off the screen. Thanks!
>
> The default JMH policy is to handle the test failure gracefully, and
> move on: this helps a lot when running large suites of tests. This can
> be overriden, you can request harness to fail on benchmark error with
> -foe ("fail on error" cmdline switch) or the similar OptionsBuilder method.
>
> Thanks,
> -Aleksey
>
> P.S. Don't ever use System.exit() in the code driven by any framework.
> In JMH, you can throw the exception out of @Benchmark/@Setup/@TearDown
> to terminate the workload.
>
>


More information about the jmh-dev mailing list