Closed elnur closed 2 years ago
Can you pinpoint where it is coming from? Its hard to say from the snippet i guess that somewhere in those tests the memory is increasing.
Is it always the same test or?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions.
Finally figured it out while figuring out a similar problem while upgrading to PHP 8.2. Turns out the massive number of deprecation warnings consumed a lot of memory.
Summary
We have over 3K tests in our project. Once I've upgraded Faker from 1.13.0 to 1.16.0, tests started exhausting memory around test 130, which is pretty soon. I downgraded until I reached 1.14.0 and the problem still persisted. Downgrading to 1.13.0 makes the problem go away.
BTW, doubling the PHP CLI memory from 2GiB to 4GiB didn't help.
Versions
fakerphp/faker
Self-enclosed code snippet for reproduction
Here's the base class all test classes extend:
initialize()
is called from PHPUnit bootstrap file. Then used unique values are being reset before each test.Expected output
Actual output