RFR: 7903526: jtreg should handle all exceptions
Jaikiran Pai
jpai at openjdk.org
Tue Oct 31 06:33:59 UTC 2023
On Tue, 10 Oct 2023 20:49:42 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:
> Currently, jtreg executes a test in MainThreadGroup and checks uncaught exceptions for this group. So it handles all exceptions if the test doesn't create new thread groups.
> However, the virtual threads don't belong to MainThreadGroup and jtreg silently ignores all exceptions thrown by virtual threads.
>
> The testing shows that we have already some problems in jdk/jdk and probably in UR releases. There are 13 test failures in tier1 and several tens in the execution of tests that use secutiry-manager and run with a virtual thread.
>
> It wonder if it makes sense to have this check conditional using some java property and start fixing tests after jtreg is release and smoothly switch execution to the new version.
src/share/classes/com/sun/javatest/regtest/agent/MainWrapper.java line 84:
> 82: globalUncaughtThrowable = e;
> 83: }
> 84: AStatus.failed(MAIN_THREW_EXCEPT + e).exit();
I think we shouldn't be failing and exiting here because the uncaught exception might have been thrown when the test is still in progress. Just keeping track of the uncaught exception(s) I think should be enough, so that that state can then be used after the test completes, to decide whether to fail the test. This is then similar to what we do in the case where no test thread factory is set.
-------------
PR Review Comment: https://git.openjdk.org/jtreg/pull/172#discussion_r1377108957
More information about the jtreg-dev
mailing list