-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[4.4] Tests slow after updating to 4.4 #34567
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
Comments
Check Blackfire.io for hints ;) |
@nicolas-grekas it's caused by symfony/http-kernel@354bcae4 |
If you want me to help, I'd need a reproducer. A blackfire comparison would be a good start in any case. |
We're seeing our tests also being far slower in 4.4. Hopefully I can provide some Blackfire profiles tomorrow :) |
Since Symfony 4.4 update, our PHPUnit tests now take ~9 minutes instead of ~15 seconds to run 586 tests and 610 assertions (we use Here some blackfire traces for only one file (running blackfire on every files make it crash):
rm -rf var/cache/test && bin/console c:c -e test
blackfire run bin/simple-phpunit tests/phpunit/Security/Voter/SectorVoterTest.php # slow
blackfire run bin/simple-phpunit tests/phpunit/Security/Voter/SectorVoterTest.php # fast
Thanks! |
Feels like the container is built a gazillion times |
Thanks for the hints. Can anyone please confirm #34580 fixes the issue? |
@nicolas-grekas yes! test speeds are back to normal :D |
I'd say tests are even faster now, amazing! |
This PR was merged into the 4.4 branch. Discussion ---------- [HttpKernel] Don't cache "not-fresh" state | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #34567 | License | MIT | Doc PR | - Commits ------- be80db3 [HttpKernel] Don't cache "not-fresh" state
@acasademont sure they are. The initial change was meant to speed them up. But that's only true when the optimizing logic is not buggy. |
Symfony version(s) affected: 4.4
Somehow our testsuite became extremely slow after updating to 4.4. It's a regular API platform setup, using hautelook fixtures. So DB is reloaded on every test.
In the
var/cache/test
it seems to boot/cache a compiled container container per testcase. If i abort after first testcase, and then restart the testsuite it seems to pick up the existing container.Moreover, the behavior is exposed using:
Im not sure where to look for now, hints welcome :) i've updated all recipes etc. so everything is "latest 4.4".
The text was updated successfully, but these errors were encountered: