-
Notifications
You must be signed in to change notification settings - Fork 328
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
Inconsistent results with many instances #272
Comments
Running this on different versions indeed gives different result. However i see PHP 7.3/7.4/8.0/latest all behave the same way. The way the example is executed though is not really a best practice where we create thousands of Faker instances.
|
@ROTGP what i can suggest is to create a single Faker instance in these ways and reseed the instance itself. |
@pimjansen yup, using a static instance and reseeding it is what I ended up doing. I understand that it's somewhat of an extreme edge-case. Feel free to close the issue. |
Summary
I have been using faker within Orchestral Testbench. My code generates many instances of faker (one for each of my tests), and each instance is seeded deterministically and generates a large number of variables. My tests started failing, especially when changing between versions of php (7.3, 8.0.1). In summary, I expect faker to behave deterministically - but it doesn't. I've included example code below. On my system, it consistently fails on iteration #5961. I'm not sure if this is a memory issue? I ended up solving it by creating a static instance of faker, and reseeding it. However, I thought I'd create this issue in case anyone else has run into this.
Versions
fakerphp/faker v1.13.0 / php 8.0.1
Self-enclosed code snippet for reproduction
The text was updated successfully, but these errors were encountered: