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

andrlos duke at openjdk.org
Thu Feb 13 16:51:23 UTC 2025


On Tue, 12 Nov 2024 09:39:03 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> @sormuras 	feast your eyes on the code below :D
>> 
>> 
>> public class CrashOnlyStatusTransformer implements StatusTransformer {
>>         @Override
>>         public Status transform(Status originalStatus, TestDescription td) {
>>             Status newStatus = originalStatus;
>>             if(originalStatus.getType() == Status.FAILED && ! this.didCrash(td)){
>>                 newStatus = new Status(Status.PASSED, "Just a regular failure.");
>>             }
>>             return newStatus;
>>         }
>> 
>>         private boolean didCrash(TestDescription td){
>>             Pattern pattern = Pattern.compile("^hs_err_pid(\\d+)\.log");
>>             List<String> hs_errs = Arrays.stream(td.getDir().list()).filter(pattern.asPredicate()).collect(Collectors.toList());
>>             return !hs_errs.isEmpty();
>>     }
>> }
>> 
>> 
>> this is an approach that we use for crashtesting with debug jdk builds to separate crashes from regular failures
>
> Hello @andrlos, looking at that code you pasted:
> 
> if(originalStatus.getType() == Status.FAILED && ! this.didCrash(td)){
>     newStatus = new Status(Status.PASSED, "Just a regular failure.");
> }
> 
> It looks odd to be marking a failed test as successful. Furthermore, doesn't a crashed JVM result in test status to be `Status.ERROR`?

@jaikiran @sormuras I believe that I answered all your questions and addressed all your comments and currently I am still waiting for a constructive discussion to take place.

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

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


More information about the jtreg-dev mailing list