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
Fix `killDescendants` signaling unrelated processes once Execa is done with the subprocessSindre Sorhusbefore adoption9c5c71c
lines 1–14why, one step back1#!/usr/bin/env node2import {execa, sendMessage} from '../../index.js';34// Spawns a descendant which ignores `SIGTERM` and keeps this process' `stdout` open.5// This process is not awaiting it, so it exits on `SIGTERM` while that descendant keeps running.6const subprocess = execa('no-killable.js', {7 ipc: true,8 killSignal: 'SIGKILL',9 stdout: 'inherit',10 cleanup: false,11});12await subprocess.getOneMessage();13await sendMessage(subprocess.pid);14setTimeout(() => {}, 1e8);