RFR: 7903526: jtreg should handle all exceptions [v2]

Leonid Mesnik lmesnik at openjdk.org
Tue Oct 31 20:47:04 UTC 2023


On Tue, 31 Oct 2023 06:31:45 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Added sync ofr globalUncaughtThrowable.
>
> 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.

I copied the handler from MainThreadGroup::uncaughtException. I want to keep them consistent. (Eventually, we are going to get rid of MainGroup.) Probably, it is needed to file a bug not to fail in the MainThreadGroup::uncaughtException and check exceptions after the test passes.

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

PR Review Comment: https://git.openjdk.org/jtreg/pull/172#discussion_r1378120397


More information about the jtreg-dev mailing list