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

David Holmes dholmes at openjdk.java.net
Sat Apr 23 06:02:27 UTC 2022


On Thu, 21 Apr 2022 16:41:02 GMT, Tyler Steele <duke at openjdk.java.net> wrote:

>> 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?

It is a test so I'm not overly concerned about scanning the output twice - though I agree it is a bit irksome to have to do that (new RFE: add `firstMatchOrFail`?). Using `reportDiagnosticSummary` is a reasonable compromise. Thanks.

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

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


More information about the hotspot-runtime-dev mailing list