ipc-send-pid-stubborn.js
This file
Path
test/fixtures/ipc-send-pid-stubborn.js
14 lines · 474 bytes · JavaScript
Last changed by
Fix `killDescendants` signaling unrelated processes once Execa is done with the subprocessSindre Sorhusbefore adoption9c5c71c
History of this fileTake it
123456789101112131415#!/usr/bin/env nodeimport {execa, sendMessage} from '../../index.js';
// Spawns a descendant which ignores `SIGTERM` and keeps this process' `stdout` open.// This process is not awaiting it, so it exits on `SIGTERM` while that descendant keeps running.const subprocess = execa('no-killable.js', { ipc: true, killSignal: 'SIGKILL', stdout: 'inherit', cleanup: false,});await subprocess.getOneMessage();await sendMessage(subprocess.pid);setTimeout(() => {}, 1e8);