[jdk17] RFR: 8268602: a couple runtime/os tests don't check exit code

David Holmes dholmes at openjdk.java.net
Fri Jun 11 12:19:51 UTC 2021


On Fri, 11 Jun 2021 09:51:24 GMT, Igor Ignatyev <iignatyev at openjdk.org> wrote:

> Hi all,
> 
> could you please review this trivial and test-only patch that adds checks of exit code to two `runtime/os` tests?
> from JBS:
>> `runtime/os/TestUseCpuAllocPath.java` and `AvailableProcessors.java` spawn new JVMs but don't check their exit code which might lead to both type-I and type-II errors
> 
> testing: ``runtime/os` on `{linux,windows,macosx}-x64`
> 
> Thanks,
> -- Igor

The value of doing this seems marginal, but strictly speaking yes every test that launches  VM should check for a zero exit code. Arguably this should be built into the ProcessTools API so that we don't have to do it explicitly. The special case would be looking for a non-zero exit code.

In the case of failure it is more efficient to check the exit code first before potentially wasting time parsing output. But we probably don't care too much about that.

Thanks,
David

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

Marked as reviewed by dholmes (Reviewer).

PR: https://git.openjdk.java.net/jdk17/pull/25


More information about the hotspot-runtime-dev mailing list