test,osx: fix flaky kill test

At least starting with Darwin Kernel Version 16.4.0, sending a SIGTERM
to a process that is still starting up kills it with SIGKILL instead of
SIGTERM.

Fixes: https://github.com/libuv/libuv/issues/1226
PR-URL: https://github.com/libuv/libuv/pull/1282
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
This commit is contained in:
Santiago Gimeno 2017-04-01 20:04:08 +02:00
parent eb8509210d
commit cd37fd0fd2
No known key found for this signature in database
GPG Key ID: F28C3C8DA33C03BE

View File

@ -90,7 +90,16 @@ static void kill_cb(uv_process_t* process,
#else
ASSERT(exit_status == 0);
#endif
ASSERT(no_term_signal || term_signal == 15);
#if defined(__APPLE__)
/*
* At least starting with Darwin Kernel Version 16.4.0, sending a SIGTERM to a
* process that is still starting up kills it with SIGKILL instead of SIGTERM.
* See: https://github.com/libuv/libuv/issues/1226
*/
ASSERT(no_term_signal || term_signal == SIGTERM || term_signal == SIGKILL);
#else
ASSERT(no_term_signal || term_signal == SIGTERM);
#endif
uv_close((uv_handle_t*)process, close_cb);
/*