Open ThomasLandauer opened 3 years ago
That error doesn't look like memory leak, PHP tries to allocate 140 terabytes in one go.
140 TB? Well, maybe I should go and buy more RAM then... ;-)
I now moved the first of the affected tests to functional suite, and the entire suite runs smoothly there. How can that be?? What's the difference between unit and functional runner?
It probably has something to do with a change I made in the app in an entity: Some setter is now doing a change in a related entity, something like:
function setOk(bool $ok)
{
$this->ok = $ok;
$this->getFoo()->setOk($ok); // <= `Foo` = related entity
}
Cause when I remove this line again, unit suite works too (i.e. fails, but doesn't crash).
When running my entire unit test suite, I'm getting one of these two errors
... always on the same tests. The only thing they have in common is that they fetch stuff from the database.
But when I run the affected test files alone, everything's fine.
This makes me suspect that something with memory management is wrong. Is the entity manager being kept in memory between test runs?