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

[Suggestion] Default timeout for generators #30

Open
AlgorithmsAreCool opened this issue Oct 23, 2024 · 2 comments
Open

[Suggestion] Default timeout for generators #30

AlgorithmsAreCool opened this issue Oct 23, 2024 · 2 comments

Comments

@AlgorithmsAreCool
Copy link

Howdy!

I incorrectly wrote a generator that called unbounded ArrayUnique from a finite Gen.OneOfConst. As a result the test hung trying to find some impossible of number of unique items. It took me a little while to understand what was happening.

What would you think of having a default timeout for Generators so that they throw exceptions after some delay if they can't produce any samples?

@AnthonyLloyd
Copy link
Owner

The sets and unique do have a fail to add throw after 1000 attempts. Where clause is 100 attempts. The where clause is configurable but not the sets. Maybe I should reduce that one or at least make it configurable.

@AlgorithmsAreCool
Copy link
Author

Interesting! Unique seemed to hang indefinitely when i misconfigured it.

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

2 participants