Commit ec76ab4
committed
bug symfony#60564 [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass (cquintana92)
This PR was merged into the 6.4 branch.
Discussion
----------
[FrameworkBundle] ensureKernelShutdown in tearDownAfterClass
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | None
| License | MIT
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.
Commits
-------
bf9786c [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| 124 | + | |
| 125 | + | |
123 | 126 | | |
124 | | - | |
| 127 | + | |
| 128 | + | |
125 | 129 | | |
126 | 130 | | |
127 | 131 | | |
| |||
0 commit comments