Skip to content
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

Depends functionality contains memory leak #5358

Open
Guite opened this issue May 10, 2023 · 2 comments
Open

Depends functionality contains memory leak #5358

Guite opened this issue May 10, 2023 · 2 comments
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

Comments

@Guite
Copy link

Guite commented May 10, 2023

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.

@Guite Guite added type/bug Something is broken version/10 Something affects PHPUnit 10 labels May 10, 2023
@sebastianbergmann sebastianbergmann added type/performance Issues related to resource consumption (time and memory) feature/test-dependencies Issues related to explicitly declared dependencies between tests and removed type/bug Something is broken labels May 10, 2023
@sebastianbergmann
Copy link
Owner

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.

@sebastianbergmann sebastianbergmann added the status/waiting-for-feedback Waiting for feedback from original reporter label Jun 7, 2023
@epdenouden
Copy link
Contributor

I will investigate this, as I have to read up on v10 and the dependency checker is largely cooked up by me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants