Open bahmutov opened 8 years ago
Here is a solution that works with the current parallelshell
:
parallelshell your_programs 'perl -we "sleep 10; exit 2;"'
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.
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?