You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using parallelshell to perform end 2 end testing, like starting a server and then making a request from another script. Most of the time, there is no error, and the request script finishes with exit code 0. Is there an option to kill everything after N second timeout if the processes have not finished before with a non-zero code?
This adds to your list one process that waits 10 seconds (you can change this number) and then fails. Parallelshell with detect this failure and kill all the other processes.
Hey! Sorry for the long delay 😅 this was just added in 3.1.0! 🎉
Use parallelshell --timeout 10 "command1" "command2" (or -t) to stop remaining commands after 10 seconds, including with --wait.
I got it verified across Node 4-26 on Linux x86_64 and Windows. On Unix it uses the existing SIGINT shutdown behavior, so processes that ignore SIGINT or leave descendants running remain a limitation. That depends on the process though, feel free to reopen if it's still an issue.
Activity
Yaakov-Belch commentedon Sep 6, 2016
Here is a solution that works with the current
parallelshell:This adds to your list one process that waits 10 seconds (you can change this number) and then fails. Parallelshell with detect this failure and kill all the other processes.
darkguy2008 commentedon Sep 30, 2026
Hey! Sorry for the long delay 😅 this was just added in 3.1.0! 🎉
Use
parallelshell --timeout 10 "command1" "command2"(or-t) to stop remaining commands after 10 seconds, including with--wait.I got it verified across Node 4-26 on Linux x86_64 and Windows. On Unix it uses the existing
SIGINTshutdown behavior, so processes that ignoreSIGINTor leave descendants running remain a limitation. That depends on the process though, feel free to reopen if it's still an issue.Thanks!