RFR: 8269135: TestDifferentProtectionDomains runs into timeout in client VM
Christoph Göttschkes
cgo at openjdk.java.net
Wed Jun 23 10:44:53 UTC 2021
On Tue, 22 Jun 2021 13:34:43 GMT, Christoph Göttschkes <cgo at openjdk.org> wrote:
> The test tries to compile a method using the WhiteBox with optimization level 4, which is not available in client VMs. The WhiteBox only prints out a warning, and the call to enqueueMethodForCompilation succeeds. After that, the test case goes into an endless loop to wait for the compilation to finish, which never happens, because the method is not enqueued for compilation.
>
> I fixed this by choosing a different compilation level, if C2 is not included in the JVM. I think this test should be enough, since there is already an `@requires` which checks, that we are in mixed mode and that C2 should be used.
>
> In addition, I bound the loop in order to fail with a timeout more early, if the compilation does not happen (or takes too long because of platform restrictions).
Thanks for your reviews.
I initially didn't want to limit the test case to tiered VMs, since the bug said "C1", but if that's OK I am fine with it as well. I also picked up one of the suggestion @eastig gave me, which is check the return value of `enqueueMethodForCompilation` since I think this is a reasonable addition and makes the test more robust.
I am not using `CompilerWhiteBoxTest.waitBackgroundCompilation`, since it had some issues with the enabled security manager and I didn't want to complicate the test case more. I think with the new `@requires` and the check of the return value from `enqueueMethodForCompilation`, we should be save here and the loop should always terminate.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4558
More information about the hotspot-runtime-dev
mailing list