RFR: 7903601 : simple fix for jtr.xml logs missing description with shell tests

Jonathan Gibbons jjg at openjdk.org
Wed Dec 6 17:17:18 UTC 2023


On Wed, 6 Dec 2023 17:12:25 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>> issue:
>> https://bugs.openjdk.org/browse/CODETOOLS-7903601
>> 
>> with "-xml" argument when a shell driven test fails, the only thing you are getting in jtr.xml file as an explanation is the exit code which is not very helpful.. this is a fix for that which aligns the behavior of shell tests with that of java tests. The solution is up for a discussion, I just did the simplest and sturdiest solution I could think of.. in case there is no "main" section in the original jtr file, the xmlwriter in jtreg tries to iterate the sections again for "shell" section and writes the failure it finds there to the jtr.xml log
>
> src/share/classes/com/sun/javatest/regtest/report/XMLWriter.java line 188:
> 
>> 186:                     for (String x : s.getOutputNames()) {
>> 187:                         return s.getOutput(name);
>> 188:                     }
> 
> The outer loop seems weird. It would be simpler to just change
> 
>  `if (titles[i].equals(section))` 
>  
>  to 
>  
>  `if (titles[I].equals("main") || titles[I].equals("shell"))` 
>  
>  or equivalent

or `if (Set.of("main", "shell").contains(titles[i]))` or equivalent

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

PR Review Comment: https://git.openjdk.org/jtreg/pull/175#discussion_r1417691305


More information about the jtreg-dev mailing list