On Tue, 13 Feb 2024 21:23:29 GMT, Dan Lutker <dlut...@openjdk.org> wrote:

>> At the time `sleep` seemed ubiquitous and was native so it ran quickly. 
>> (Much quicker than running java).
>> Running another program would be fine.  For example ,selecting an executable 
>> based on the OS type and giving the expected string in the output would be 
>> preferred.
>> The isBusyBox check is also a bad hack, but lighter weight since its not 
>> executing a program.
>> As the number of minor variations of platforms appear a more general 
>> approach would be useful.
>> 
>> I'd code it all in the test itself, doing a lookup based on the operating 
>> system name with the respective executable and expected string in the info 
>> arguments[0].
>> (With a fallback to sleep, so the table does not have to list every os).
>
> Any reason not to use 
> [exesanity_SimpleNativeLauncher](https://github.com/openjdk/jdk/blob/628cd8a489fd54db18204c3bbaf4339d7ab5e9d6/test/jdk/native_sanity/simplenativelauncher/exesanity_SimpleNativeLauncher.c)
>  or 
> [exeBasicSleep](https://github.com/openjdk/jdk/blob/628cd8a489fd54db18204c3bbaf4339d7ab5e9d6/test/jdk/java/lang/ProcessBuilder/exeBasicSleep.c)
>  in all cases?

I'd be ok with exeBasicSleep; (currently only used on Windows and if its been 
built by the make files).
Note the discovery mechanism used in Basic.java `initSleepPath()` to locate and 
identify the path where its built or to fallback to the OS sleep.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17798#discussion_r1488640847

Reply via email to