I'm using Behat for testing a Symfony2 application. Whilst each Feature test runs happily when run in isolation, trying to run the whole test suite in one go leads to PHP running out of memory - even when the memory_limit is set to 2GB and higher.
By echoing the current memory usage at the end of each Feature, I can see that memory usage increases by between 20 and 50MB for each feature that runs.
So, my question is, "is there anything I can do to free up memory after each Feature has run?" It appears that each Feature is booting up another Symfony application, so, my ideal solution would be to destroy each Symfony application (assuming that is what is happening) after each Feature has run using an @AfterFeature hook.
Updated to add: We're using Symfony 2.3.7 and Behat 2.5.0.
Updated to add: A typical use case is;
- use Doctrine to put the system / entities into a known state;
- simulate a user clicking on various links, filling in form fields etc;
- use Doctrine to check that the entities are the expected state