-
Notifications
You must be signed in to change notification settings - Fork 167
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
Atom generator exhausts the atom limit #290
Comments
Atom garbage collection is something known to be missing from Erlang/OTP's implementation for many years now, and a limitation which has forced most Erlang developers to write ugly and/or unnatural code in many of their programs. Moreover, the implementation of an atom garbage collector is not rocket science. So, perhaps it's high time that it is implemented. If property-based testing is something that is of use to Erlang/OTP and your particular way of using the In my opinion, artificially limiting the |
Well, I have no real idea how that works internally, I have my guesses and some cloudy memory. But I think it's not just a simple matter of not wanting to bother of cleaning up after yourself 😜 And I don't think my particular way of using That said, personally I didn't feel any need for more or infinite atoms, and I would second-guess any production code that needs it. On the other hand, I understand that limiting the generators is contrary to what property testing is really about: generating all sorts of possible input. But I don't see how the two will be brought together 🤷♀️ |
On a side note, an interesting point that came up in the discussion was that atoms generated purely at random alone are not all that useful. There are certain "interesting" atoms (well-known ones like |
The
atom()
generator produces atoms at random, with no limitations whatsoever. By extension, this is also true for union generators liketerm()
. As atoms are never garbage collected, this means that over time the limit on the number of atoms in a runtime instance will get exhausted. How quickly that happens depends on how generators are used, how many properties there are in a suite, and how many suites there are.We are working on property tests for OTP, currently for the
lists
module. We have 71 properties so far and are not done yet, but we already encounter failures because the atom space in exhausted. Yes, we can tune our generators to generate atoms more economically (cumbersome and makes tests more artificial), but still, this puts a tight lid on things in general. Going to extremes, it would never be possible to equip all of OTP with property tests, not even all ofstdlib
.The text was updated successfully, but these errors were encountered: