-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fix Symfony 5.2 compatibility because Kernel::preBoot() broke the current implementation #37
Conversation
Did a really dumb test on this issue and it turns out the cache is not copied due the preBoot function being added in Symfony 5.2. To test it, I required public function handle(Request $request, int $type = HttpKernelInterface::MASTER_REQUEST, bool $catch = true)
{
var_dump('handle');
var_dump(scandir('/tmp/cache/prod'));
var_dump(scandir($_SERVER['LAMBDA_TASK_ROOT'].'/var/cache/prod'));
return parent::handle($request, $type, $catch);
}
public function boot()
{
var_dump('boot');
var_dump(scandir('/tmp/cache/prod'));
var_dump(scandir($_SERVER['LAMBDA_TASK_ROOT'].'/var/cache/prod'));
parent::boot();
}
protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container, string $class, string $baseClass)
{
var_dump('dumpContainer');
parent::dumpContainer($cache, $container, $class, $baseClass);
} You can see the dump below but it basically goes like so
So Symfony is generating a new cache in /tmp and the deployed pre-warmed cache is never copied.
|
Following investigation on why the tests are NOT failing here. We are actually testing with the console which also uses the Kernel but the console is not calling preBoot (this function was introduced for some http related feature) so it doesn't fail and work as expected but in a console context. We should probably change the tests to simulate an HttpRequest instead |
d17f7a6
to
07f8e86
Compare
Ok, I fixed the tests to fail on Symfony 5.2 where the behaviour of This commit is a point at which the tests are failing but the bug was not resolved and we can see all 5.2 tests on all PHP versions are failing while others are fine. I'll now work on making it all green again 🚥 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for going through all of that!
@mnapoli you're welcome 🙂 That was easier than I thought once I understood why the tests were not failing on 5.2 |
No description provided.