Open rpander93 opened 6 years ago
This is my test class: https://gist.github.com/rpander93/97c37a7b33b0eddd8e76be0f3f83a741
Debugging output by placing some lines in WebTestCase.php and Kernel.php:
Creating kernel for cache: test Initializing container... executing cache warmer.... Initializing container... executing cache warmer.... Creating kernel for cache: test Initializing container... executing cache warmer.... Initializing container... executing cache warmer....
A possible solution: use traits instead of inheriting from the big test class, see https://github.com/liip/LiipFunctionalTestBundle/issues/332#issuecomment-329958638
Hi all,
I'm working on an app using Symfony4.1 and I noticed my testsuite becoming incredibly slow with this bundle enabled. Some debugging showed me that the container is initialized multiple times per test, causing the cache to get recreated also.
I refactored my test to use the WebTestCase provided by Symfony rather than the one provided by this bundle. That already helped somewhat. If I disable the bundle completely in bundles.php, the issue vanishes completely.
In the end, the time required for 1 test class with 2 tests drops from 1.5m to 4s.
Preconditions
Steps to reproduce
Expected result
Actual result