[jdk17] RFR: 8271158: runtime/handshake/HandshakeTimeoutTest.java test doesn't check exit code
Igor Ignatyev
iignatyev at openjdk.java.net
Thu Jul 22 19:47:10 UTC 2021
On Thu, 22 Jul 2021 19:28:17 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:
>> Hi all,
>>
>> could you please review this one-liner that adds an exit code check to `runtime/handshake/HandshakeTimeoutTest.java` test?
>>
>> Thanks,
>> -- Igor
>
> test/hotspot/jtreg/runtime/handshake/HandshakeTimeoutTest.java line 63:
>
>> 61: output.reportDiagnosticSummary();
>> 62: // In rare cases the target wakes up and performs the handshake at the same time as we timeout.
>> 63: // Therefore it's not certain the timeout will find any thread.
>
> The comment on L62-63 indicates that this line:
>
> L64: output.shouldMatch("has not cleared handshake op|No thread with an unfinished handshake op");
>
> will sometimes finish with "No thread with an unfinished handshake op". In that case,
> won't the test finish with an exit code of zero?
>
> If I'm right about that, you've introduced a rare case where the test will
> fail (because the exit code is 0) when it would have passed before.
given `HandshakeTimeoutTest$Test` will work till it crashes, its exit code can't be 0. which, I *guess*, means we will always have "has not cleared handshake op".
-------------
PR: https://git.openjdk.java.net/jdk17/pull/270
More information about the hotspot-runtime-dev
mailing list