RFR: 8284303: runtime/Thread/AsyncExceptionTest.java timed out
Patricio Chilano Mateo
pchilanomate at openjdk.java.net
Tue Apr 5 21:35:41 UTC 2022
On Tue, 5 Apr 2022 21:12:01 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> Please review this small fix to test runtime/Thread/AsyncExceptionTest.java. On rare cases the methods never reach the desired compilation level so the worker thread just gets blocked and the test times out.
>> I added a bail out after a couple of seconds of waiting.
>> Was able to reproduce the issue and checked the test doesn't timeout anymore with the fix.
>>
>> Thanks,
>> Patricio
>
> The test is very non-deterministic. Depending on CPU speed and other factors `thread.stop` may arrive at any time (compilation is not blocking from what I see).
> Do you want to test it when methods in Interpreter, compiled by C1 or C2, or all these cases? Then you need to test each such case separately and not depend on luck. You can do it by requiring present of C1 and C2 (or simply looking what compilation levels are available). And then run testing thread with different compilation level (including 0 - Interpreter) to make sure `Thread.stop` is delivered in all modes (if that is what you are looking for).
>
> Why you included compilation request into testing thread? You can precompile methods in main() so you don't need to check it during testing time and use `receivedThreadDeathinInternal2` and `realRun`. There are WB API for compiling methods instead of calling them in loop.
Thanks for taking a look at this @vnkozlov.
> The test is very non-deterministic. Depending on CPU speed and other factors `thread.stop` may arrive at any time (compilation is not blocking from what I see).
>
The worker actually waits in checkCompLevel() until the methods are compiled, before the real run. So either the methods are compiled or the worker will just wait and hence the timeout in these cases. I could have moved it to the main thread though as you mentioned below and use the WB methods to compile directly.
>Do you want to test it when methods in Interpreter, compiled by C1 or C2, or all these cases? Then you need to test each such case separately and not depend on luck. You can do it by requiring present of C1 and C2 (or simply looking what compilation levels are available). And then run testing thread with different compilation level (including 0 - Interpreter) to make sure `Thread.stop` is delivered in all modes (if that is what you are looking for).
>
I want to run the test with those methods() compiled(internalRun2/internalRun1), don't really care if C1 or C2.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8097
More information about the hotspot-runtime-dev
mailing list