Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to close after N seconds? #40

Open
bahmutov opened this issue Nov 16, 2015 · 1 comment
Open

Is there a way to close after N seconds? #40

bahmutov opened this issue Nov 16, 2015 · 1 comment

Comments

@bahmutov
Copy link

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?

@Yaakov-Belch
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants