Skip to content

[FrameworkBundle] ensureKernelShutdown in KernelTestCase::tearDownAfterClass #60693

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

Conversation

cquintana92
Copy link
Contributor

@cquintana92 cquintana92 commented Jun 4, 2025

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues None
License MIT

Comes from #60564

This PR performs the following change: In KernelTestCase, the kernel is shut down after every test, as per the static::ensureKernelShutdown() call in the tearDown function. However, if one was to perform any extra code in their tearDownAfterClass and call getContainer, it would boot up a new kernel, which would then be left dangling. The main issue with that is that when the next Test class is executed, there would already be a booted kernel, so it could happen that it was pointing to dangling resources.

By adding this call to static::ensureKernelShutdown in the tearDownAfterClass, we can ensure that no dangling kernels are left even after the test class has finished.

@carsonbot carsonbot changed the title chore: ensureKernelShutdown in tearDownAfterClass [FrameworkBundle] chore: ensureKernelShutdown in tearDownAfterClass Jun 4, 2025
@nicolas-grekas nicolas-grekas changed the title [FrameworkBundle] chore: ensureKernelShutdown in tearDownAfterClass [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass Jun 4, 2025
@nicolas-grekas nicolas-grekas modified the milestones: 7.4, 6.4 Jun 4, 2025
@nicolas-grekas nicolas-grekas changed the base branch from 7.4 to 6.4 June 4, 2025 14:58
@nicolas-grekas nicolas-grekas changed the base branch from 6.4 to 7.4 June 4, 2025 14:59
@cquintana92 cquintana92 force-pushed the chore/ensure-kernel-shutdown-teardownafterclass branch from 7f3f2b0 to de4c4d7 Compare June 4, 2025 14:59
@nicolas-grekas nicolas-grekas changed the title [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass [FrameworkBundle] ensureKernelShutdown in KernelTestCase::tearDownAfterClass Jun 4, 2025
@nicolas-grekas nicolas-grekas changed the base branch from 7.4 to 6.4 June 4, 2025 15:01
@nicolas-grekas nicolas-grekas force-pushed the chore/ensure-kernel-shutdown-teardownafterclass branch from de4c4d7 to c193b98 Compare June 4, 2025 15:01
@nicolas-grekas
Copy link
Member

Thank you @cquintana92.

@nicolas-grekas nicolas-grekas merged commit de57965 into symfony:6.4 Jun 4, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy