You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been practicing property-based testing with this library and I've run into a few instances of tests taking a very long time to run and eventually failing with exit code -1.
Here is an implementation of division where I purposefully return multiplication to test division's properties:
I initially thought that the test was hanging but it actually took 6 minutes to run and eventually failed without telling me on what values. It works fine when I change num1 * num2 to num1 / num2 so I believe the issue has something to do with glados' shrinking in regards to doubles since the following code failed quickly without issues:
doublediv(int num1, int num2) => (num1 * num2).toDouble();
Indeed, this was an error in the shrinking of doubles. In particular, it seems like the shrinking just generated a huuuuge amount of values (which, admittedly, were all smaller than the original).
I simplified the shrinking code to turn 3.2 -> 2.2 etc. (so, move numbers one closer to zero) and after that's not working, round values to some decimal places.
Your test case (which I also added as a regression test) seems to be fixed by that.
OS: Windows 11
IDE: IntelliJ Idea
Dart SDK:
'>=2.17.6 <3.0.0'
Dependencies:
I've been practicing property-based testing with this library and I've run into a few instances of tests taking a very long time to run and eventually failing with
exit code -1
.Here is an implementation of division where I purposefully return multiplication to test division's properties:
and my only test is:
I initially thought that the test was hanging but it actually took 6 minutes to run and eventually failed without telling me on what values. It works fine when I change
num1 * num2
tonum1 / num2
so I believe the issue has something to do with glados' shrinking in regards todouble
s since the following code failed quickly without issues:The text was updated successfully, but these errors were encountered: