You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the container fails to build (e.g. due to misconfigured services), Symfony does not release the lock created here. This causes subsequent calls to bootKernel() (e.g., in a test suite running multiple tests) to freeze indefinitely on flock().
Steps to Reproduce
Create a misconfigured service (e.g. missing required constructor argument).
Create a PHPUnit test with at least 2 test cases and a setup method that boots the kernel.
Run tests.
Watch it freeze on the second test case setUp method.
Actual Behaviour
The first test's setUp method is executed and bootKernel is called, it throws as expected because of misconfigured service, but the .lock file is not released.
The second test's hangs indefinitely while trying to acquire the lock.
No cleanup happens when the exception is thrown.
Expected Behaviour
The .lock file should be released when compiling the container fails, to prevent deadlocks or the tests should fail immediately.
I couldn’t reproduce using PHP 8.4.5 on Ubuntu 22.04. If the behavior you observe is tied to your environment it would be good to add a corresponding Dockerfile to the repository.
Symfony version(s) affected
7.1
Description
When the container fails to build (e.g. due to misconfigured services), Symfony does not release the lock created here. This causes subsequent calls to bootKernel() (e.g., in a test suite running multiple tests) to freeze indefinitely on flock().
Steps to Reproduce
Actual Behaviour
The first test's setUp method is executed and bootKernel is called, it throws as expected because of misconfigured service, but the .lock file is not released.
The second test's hangs indefinitely while trying to acquire the lock.
No cleanup happens when the exception is thrown.
Expected Behaviour
The .lock file should be released when compiling the container fails, to prevent deadlocks or the tests should fail immediately.
Relevant file
Kernel.php
How to reproduce
PostRepository
service (missing constructor call).bin/phpunit tests/ExampleTest.php
Temporal work around
The text was updated successfully, but these errors were encountered: