RFR: 7903519 : jtreg/jtharness is missing features for basic crash testing

andrlos duke at openjdk.org
Tue May 27 14:15:20 UTC 2025


On Wed, 7 May 2025 14:18:00 GMT, Christian Stein <cstein at openjdk.org> wrote:

>> provides SPI for enabling external status transformations of failed tests
>> 
>> this is a continuation of efforts after https://github.com/openjdk/jtharness/pull/59 
>> 
>> Requires newest jtharness build (not even tagged yet) that includes above mentioned change to be compiled succesfully
>> 
>> The main idea is to provide a unified StatusTransformer interface, that can be externally implemented by users and added to a classpath in a separate jar to allow modifications of test execution status based on some elementary analysis. This can be easily used for crashtesting (filtering out only tests with jvm crashes).
>
> What I still don't get is that you want to address a global goal "basic crash testing" with a very local mechanism, like something similar to JUnit 4 "TestRule".
> 
> I think a solution lies in between your lines:
> 
>> it proved to be much harder to filter them after, as the `hs_err_pid` log is not being copied, plus we have many tests that run via a shell script, so a generic jvm watcher is not an option as would be the option with jvm agent that we use for junit testing.. we need to cover cases, where jvm crashes even tho it has been run via a shell script (or multiple levels of scripts) and watching for `hs_err_pid.log` proved to be the most reliable and universal approach.
> 
> So, what about making sure that `jtreg` copies `hs_err_pid` files correctly?

@sormuras 	can definitely be tried, I did want to do something with minimal code changes as I saw it as a best chance to get it approved. Plus the TestRule approach is a very powerful way of doing so much more and could be used for other purposed in the future as well. However I can definitely give hs_err_pid files copying a look and see. Hopefully this wont break anything else.
Thanks for this short brainstorming, will get back to you, once I get a PoC working.

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

PR Comment: https://git.openjdk.org/jtreg/pull/235#issuecomment-2912670151


More information about the jtreg-dev mailing list