-
- Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
feature/test-runnerCLI test runnerCLI test runnertype/enhancementA new idea that should be implementedA new idea that should be implementedtype/performanceIssues related to resource consumption (time and memory)Issues related to resource consumption (time and memory)
Description
The garbage collector can be already configured to run after every X (default: 100) Tests.
I realized most memory can be freed up when a test-case with all its tests is finished:
May we add a configuration option to also trigger the garbage collector on event AfterLastTestMethodFinished?
E.g. trigger a new function GarbageCollectionHandler::lastTestMethodFinished
public function lastTestMethodFinished(): void { gc_collect_cycles(); $this->facade->emitter()->testRunnerTriggeredGarbageCollection(); $this->tests = 0; }Current triggers:
phpunit/src/Runner/GarbageCollection/GarbageCollectionHandler.php
Lines 75 to 86 in 3e6c0dc
| /** | |
| * @throws EventFacadeIsSealedException | |
| * @throws UnknownSubscriberTypeException | |
| */ | |
| private function registerSubscribers(): void | |
| { | |
| $this->facade->registerSubscribers( | |
| new ExecutionStartedSubscriber($this), | |
| new ExecutionFinishedSubscriber($this), | |
| new TestFinishedSubscriber($this), | |
| ); | |
| } |
Metadata
Metadata
Assignees
Labels
feature/test-runnerCLI test runnerCLI test runnertype/enhancementA new idea that should be implementedA new idea that should be implementedtype/performanceIssues related to resource consumption (time and memory)Issues related to resource consumption (time and memory)