Skip to content

TestCase is instanciated per test (correct), but not destroyed immediatelly (wrong, non GCable) #4705

@mvorisek

Description

@mvorisek
Q A
PHPUnit version 9.5.5
PHP version 7.4
Installation Method Composer

Summary

TestCase is instanciated per test (correct), but not destroyed immediatelly (wrong, non GCable)

Current behavior

not destroyed immediatelly

How to reproduce

see atk4/data@849a548 and related output https://github.com/atk4/data/runs/2782214124#step:8:31 (can be reproduced by running phpunit locally)

In the output, you can see that x representing TestCase::__destruct call is called after all tests are done.

Expected behavior

TestCase must be destroyed immediatelly after a test finishes. It is important to allow GC to free the TestCase instance immediatelly. This should be also tested in unit tests so same issue does not happen again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature/test-runnerCLI test runnertype/performanceIssues related to resource consumption (time and memory)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions