Depends functionality contains memory leak
| Q | A |
|---|---|
| PHPUnit version | 10.1 |
| PHP version | 8.2.5 |
| Installation Method | Composer |
Summary
When test cases are related with each other using the "depends" attribute/annotation PHPUnit 10 uses much more memory than PHPUnit 9 did. It feels like it would clone the object that is assigned to the dependent test case instead of using a reference to the existing one.
Current behavior
Currently assigning objects to a dependent test case uses additional memory. Calling a private (non-test) method instead does not.
How to reproduce
Create a sequence/cascade of test cases that return objects and assign them to the next one.
Expected behavior
Switching from PHPUnit 9 to 10 should not cause huge differences with regards to memory consumption.
Thank you for your report.
Please provide a minimal, self-contained, reproducing test case that shows the problem you are reporting.
Without such a minimal, self-contained, reproducing test case I will not be able to investigate this issue.
I will investigate this, as I have to read up on v10 and the dependency checker is largely cooked up by me.