parallelshell icon indicating copy to clipboard operation
parallelshell copied to clipboard

Is there a way to close after N seconds?

Open bahmutov opened this issue 9 years ago • 1 comments

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?

bahmutov avatar Nov 16 '15 20:11 bahmutov

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.

Yaakov-Belch avatar Sep 06 '16 09:09 Yaakov-Belch