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

Leonid Mesnik lmesnik at openjdk.org
Tue May 9 03:36:26 UTC 2023


On Tue, 9 May 2023 03:03:37 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> I removed 'new RuntimeException' to make the exception chain more similar to the original one. This exception is thrown by method main() and not going to be handled but printed only. The test which tries to search the exception in the output of a spawned process by classname might be confused if found 'RuntimeException' instead of the expected one.
>
> 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.

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

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


More information about the hotspot-dev mailing list