In a desperate attempt to properly test my Java code, which includes being aware of any unhandled exception, I routinely use setUncaughtExceptionHandler for my worker threads, which intercepts exceptions, makes some noise and calls System.exit(1) which I notice (in Java by default non-main threads are OK(!) to die at any point if they encounter an exception - they will do so silently i.e. without bringing down the process).
My problem is JUnit5 (with gradle) reports a test that dies in this way, as "SKIPPED" aka Ignored, rather that failed. To my surprise, the testsuite reports SUCCESS. Googling "make junit fail on System.exit" doesnt't help. What am I missing? How to make JUnit fail in such circumstances?