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

Add timeout for tests? #236

Open
giltho opened this issue Feb 11, 2020 · 3 comments
Open

Add timeout for tests? #236

giltho opened this issue Feb 11, 2020 · 3 comments

Comments

@giltho
Copy link

giltho commented Feb 11, 2020

Adding optional timeouts for tests would be nice (to detect infinite loops for example)

@giltho
Copy link
Author

giltho commented Feb 11, 2020

Apparently, designing a timeout function is quite difficult on non-unix machines (ocaml/ocaml#5908) so I am not sure if this is possible or not.
This is a sad limitation of OCaml right here :/
If anyone has any idea of how one could do that in the case of Rely it would be great, otherwise this can at least serve as documentation for why it isn't implemented in Rely

@kyldvs
Copy link
Contributor

kyldvs commented Feb 11, 2020

Yes this would be a cool feature, but looks challenging based on the limitations you point out.

I wonder if we can work around this by moving tests that have a timeout specified to a separate process which we can kill if it exceeds their timeout. That might be possible even cross platform

@giltho
Copy link
Author

giltho commented Feb 11, 2020

That could work indeed !
Building up on what you say, maybe this could be done by compiling a tiny bit differently when targeting JS and when targeting native :

  • Use the node API when targeting js
  • Using Unix directly, and a sub-process for native.

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

2 participants