-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
I can't seem to figure out how to kill a process on Windows. What am I doing wrong?
const ac = new AbortController()
const { signal } = ac
const jobsProcess = $({ signal })`yarn rw jobs work`.timeout(19600)
jobsProcess.stdout.on('data', (data) => {
console.log('jobsProcess stdout data', data.toString())
})
setTimeout(() => {
console.log('Killing jobsProcess SIGINT')
jobsProcess.kill('SIGINT')
setTimeout(() => {
console.log('Killing jobsProcess SIGTERM')
jobsProcess.kill('SIGTERM')
}, 100)
setTimeout(() => {
console.log('Killing jobsProcess SIGTERM')
jobsProcess.kill('SIGTERM')
}, 200)
setTimeout(async () => {
console.log('Killing jobsProcess SIGKILL')
await jobsProcess.kill('SIGKILL')
console.log('After killing jobsProcess with SIGKILL')
}, 400)
setTimeout(() => {
console.log('Aborting jobsProcess')
ac.abort('Should be done by now')
}, 1000)
}, 9600)
const { stdout, stderr } = await jobsProcess
console.log('Job finished')I see all the console logs, except the last one ('Job finished'). The process just keeps running (and keeps spitting out "jobsProcess stdout data" from the .stdout.on handler)
It all works great locally on my Mac, and on Ubuntu on GitHub CI. But not on Windows on GitHub CI.
How do I kill the process on Windows?