-
Notifications
You must be signed in to change notification settings - Fork 64
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
Shrinking stateful chain yields OutOfMemoryError #338
Comments
Need a reproducible example for that. |
It looks like one of the streams within There were 721601 instances of Unfortunately, jqwik did not print the seed to reproduce before failing 🤷♂️ |
Just for reference, there's |
@vlsi Which JDK version did you use. The SO answer suggests that the problem was fixed in JDK 10, which would narrow down if it really is the same problem. |
@vlsi Did the OME occur more than once? Have you a way to replicate it? |
As far as I can see, the current implementation of JqwikStreamSupport.concat(..) does not use flatMap under the hood, so the SO issue wouldn't apply. |
I tried both 11 and 17 -- both crash at will. It might be a new JDK bug though. I did examine a lot the shrinking code that breaks, and it looked fine to me. I can probably build something similar if you consider merging that to jqwik. Basically I need to randomize database table structure, however, my current jqwik code relies on my model DSL a lot, so I can't easily extract a small sample |
For clarification: Something similar to what? A new implementation of |
Something similar to a "stateful testing" I am working on (==a use-case for stateful testing). |
Would be something for the examples section then? |
I close since I cannot reproduce. Feel free to reopen if you can provide a reproducible example. |
One more idea: it looks like See https://stackoverflow.com/a/31580392/1261287 WDYT of adding https://github.com/amaembo/streamex for An alternative option could probably stop using |
It looks like a trustworthy lib. Thing is that I want to forgo any hard depencency until jqwik cannot solve a pressing issue without it. What about:
|
I tried "proper sort limit" in https://github.com/jlink/jqwik/pull/436/files#diff-24f2363e5b549d73b76a697390516a86b444e6f9962c24032fb71a4dc7ce12ceR48-R49, however, it does not really solve the issue. The cause might be "some other shrinker producing too many shrink candidates". |
You mean, it does NOT really solve the issue? |
It does NOT solve the issue of "too long shrinking duration", however, I tried it only for the newly added However, it might still help for other usages in jqwik. |
In fact, For instance, here's a sample stacktrace during
As you see, there's I'm inclined all the shrinkables must have a hard limit on the number of produced elements. This would significantly improve shrinking the collections, especially long ones like 1000 elements. For instance, |
Limiting the search space will improve shrinking times but potentially make shrinking results worse. I tend to review such changes against the samples in https://github.com/jlink/shrinking-challenge but I haven't done so in a while. |
Testing Problem
Shrinking stateful chain causes the following.
I'll attach details from the heap dump soon
The text was updated successfully, but these errors were encountered: