RFR: 8253794: TestAbortVMOnSafepointTimeout never timeouts [v2]

Daniel D.Daugherty dcubed at openjdk.java.net
Mon Oct 5 15:35:51 UTC 2020


On Fri, 2 Oct 2020 06:48:35 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

>> test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java line 71:
>> 
>>> 69:         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
>>> 70:                 "-XX:+UnlockDiagnosticVMOptions",
>>> 71:                 "-XX:-UseBiasedLocking",
>> 
>> I think "-XX:-UseBiasedLocking" is specified to make sure
>> that Biased Locking is disabled even in test tasks where it
>> is enabled by task specific flags.
>
> Yes. But now this test is fine with using biased locking.

Okay thanks for the clarification.

>> test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java line 79:
>> 
>>> 77:             }
>>> 78:         }
>>> 79:         output.shouldNotHaveExitValue(0);
>> 
>> Looks like the test doesn't require that this mesg get printed:
>> `System.out.println("This message would occur after some time.");`
>> 
>> And it is set up to detect that the SafepointTimeout happened
>> which is what we want the test to verify at the core.
>
> The line "This message would occur after some time." should never be print if VM is working.
> If the VM fails for some reason and the timeout is not performed, line:
> "Timed out while spinning to reach a safepoint." is never printed and the OutputAnalyzer fails the test.
> If we did timeout and it was printed we know that we didn't print the other message, since the only thread that can
> timeout is the one printing that message.
> The second part verifies that the SIGILL was delivered.

Okay, but then this message when you're reading the code is misleading:
`System.out.println("This message would occur after some time.");`
It should be printing something like:
`System.out.println("This message only prints if something is broken.");`

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

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


More information about the hotspot-runtime-dev mailing list