RFR: 8307486: ProcessTools.java should wait until vthread is completed before checking exceptions

David Holmes dholmes at openjdk.org
Tue May 9 04:53:18 UTC 2023


On Tue, 9 May 2023 03:33:14 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:

>> Surely any such tests would have failed by now if that were the case? Propagating an exception in one thread when the exception was actually generated and thrown in another is normally considered a source of confusion.
>
> Really, I am not sure there are currently tests that search the exception name in process output, but they would fail because of wrapping exceptions with RuntimeException(...).
> Please note, that thread factory mode. The ProcessTools.main() in this tries to run the main()method of test in another thread. Agree for human might be more confusing, however in this mode is should be something expected. However, I just to reduce positive false positive failures related to changed exception name.
> 
> If the test normally throws an exception then it is printed like:
> Exception in thread "main" java.lang.RuntimeException: java.lang.Error: Expected
> instead the original
> Exception in thread "main" java.lang.Error: Expected
> and it might confuse the output parser. The goal is to return to the original printing.

If the parser is looking for `java.lang.Error: Expected` via `output.shouldContain` then it will still work fine.

But okay

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13873#discussion_r1188128233


More information about the hotspot-dev mailing list