Depends functionality contains memory leak #5358
Labels
feature/test-dependencies
Issues related to explicitly declared dependencies between tests
status/waiting-for-feedback
Waiting for feedback from original reporter
type/performance
Issues related to resource consumption (time and memory)
version/10
Something affects PHPUnit 10
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.
The text was updated successfully, but these errors were encountered: