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

Exit after certain time has gone by #248

Closed
jchauncey opened this issue Apr 4, 2016 · 3 comments
Closed

Exit after certain time has gone by #248

jchauncey opened this issue Apr 4, 2016 · 3 comments

Comments

@jchauncey
Copy link

I would like the tests to exit if they take longer than say 5 minutes to complete. I know this functionality exists in go test but doesn't seem to exist in ginkgo

@robdimsdale
Copy link
Contributor

@jchauncey sounds like a reasonable request. I imagine if you wanted to submit a PR we would probably merge that - we don't currently have the resources to do that ourselves.

If you're interested in submitting a PR, let us know and @onsi or I can guide you as to what you might want to look at.

@sivagollapalli
Copy link

@robdimsdale I would like to give a shot but I am a newbie. Any references would be great

@robdimsdale
Copy link
Contributor

Thanks, @sivagollapalli

I would probably add a flag called timeout to: https://github.com/onsi/ginkgo/blob/master/ginkgo/run_watch_and_build_command_flags.go#L26-L29 and https://github.com/onsi/ginkgo/blob/master/ginkgo/run_watch_and_build_command_flags.go#L112-L116.

I would suggesti that its value could be an int (seconds) or a string that golang can parse. The latter is probably better.

As far as the implementation, I would expect the actual timeout logic to live in https://github.com/onsi/ginkgo/blob/master/ginkgo/suite_runner.go. I suspect we would want a timeoutHandler similar to how we have an interruptHandler - this timeout handler would be invoked somewhere in https://github.com/onsi/ginkgo/blob/master/ginkgo/suite_runner.go#L115-L150 - similar to how the interruptHandler is invoked in the compilation step above.

There's an interesting question as to whether timeout should apply to untilItFails - i.e. either end the process when a test fails, or after a specified amount of time. I would suggest that we probably should add timeout to that execution mechanism too. We will probably get this for free as a consequence of the above design.

This is all high-level, and @onsi might have some design thoughts here too. If you decide to contribute please feel free to reach out for further guidance.

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

No branches or pull requests

3 participants