RFR: 8284303: runtime/Thread/AsyncExceptionTest.java timed out

Vladimir Kozlov kvn at openjdk.java.net
Tue Apr 5 22:34:42 UTC 2022


On Mon, 4 Apr 2022 21:16:19 GMT, Patricio Chilano Mateo <pchilanomate 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

Okay. So you want to test only compiled code. Note, since code path in tests methods is different (depends on `realRun`) methods could be recompiled again during `real` run. I suggest to use `-Xcomp` since you want them compiled always. 

1) add `@requires vm.compiler1.enabled | vm.compiler2.enabled`
2) add flags to `@run` command (blocking compilation for test methods only): 

-Xcomp -XX:CompileCommand=dontinline,AsyncExceptionTest::internalRun2
-XX:CompileCommand=compileonly,AsyncExceptionTest::internalRun1
-XX:CompileCommand=compileonly,AsyncExceptionTest::internalRun2

3) With Xcomp methods will be compiled on first call - you can skip pre-compilation (as I said, they will be recompiled anyway).
4) I don't think you need to check that methods are compiled - `-Xcomp` should guarantee it.

Note, you don't need second `dontinline` command because only these 2 methods will be compiled.

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

PR: https://git.openjdk.java.net/jdk/pull/8097


More information about the hotspot-runtime-dev mailing list