CsCheck icon indicating copy to clipboard operation
CsCheck copied to clipboard

[Suggestion] Default timeout for generators

Open AlgorithmsAreCool opened this issue 1 year ago • 3 comments

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?

AlgorithmsAreCool avatar Oct 23 '24 22:10 AlgorithmsAreCool

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.

AnthonyLloyd avatar Oct 31 '24 14:10 AnthonyLloyd

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

AlgorithmsAreCool avatar Oct 31 '24 15:10 AlgorithmsAreCool

The was a bug in GenArrayUnique that I didn't see that meant the bad count was always getting reset to 0. This is fixed in 4.2.1.

AnthonyLloyd avatar May 26 '25 13:05 AnthonyLloyd