RFR: 8283643: [AIX, testbug] MachCodeFramesInErrorFile test fails to find 'Native frames' text [v5]

Tyler Steele duke at openjdk.java.net
Thu Apr 21 16:44:36 UTC 2022


On Wed, 20 Apr 2022 19:09:15 GMT, Doug Simon <dnsimon at openjdk.org> wrote:

>> Tyler Steele has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Revert "Test: Sample error with no printing should print hs_err output"
>>    
>>    This reverts commit 6c70a45d862c1aa26d9c4d585bf8ecd39892e3bb.
>>  - Adds logging to stdout/stderr to prevent too-long Exception messages.
>
> test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java line 133:
> 
>> 131:             System.out.println("stdout:\n" + output.getStdout());
>> 132:             System.err.println("stderr:\n" + output.getStderr());
>> 133:             throw new RuntimeException("Did not find hs_err_pid file in output");
> 
> Why this change (and a similar one at the end of the file)? This separates the reporting of a failed condition (i.e., could not find expected patten in output) from the context (i.e. contents of stderr and stdout) that assists in diagnosing why the condition may have failed.

@dougxc, I added [an explanation](https://github.com/openjdk/jdk/pull/8094/files#r855362995) to the similar change at the end of the file. That was the one I discovered first. Here I made a similar change to prevent the same issue from occurring.

@dholmes-ora, I don't think output.shouldMatch is the best choice here because it involves doing the same operation twice. I believe I would end up looking for the pattern and throwing an error with shouldMatch, then looking for the pattern again and returning the String with firstMatch. I do like your idea of using more standard code however. I would like to replace the calls to println with `output.reportDiagnosticSummary()` if that is a reasonable compromise to your suggestion?

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

PR: https://git.openjdk.java.net/jdk/pull/8094


More information about the hotspot-runtime-dev mailing list