Task #55850

Task #51436: Standalone unit test runner

Reduce memory footprint of unit tests

Added by Christian Kuhn over 1 year ago. Updated over 1 year ago.

Status:Resolved Start date:2014-02-10
Priority:Should have Due date:
Assigned To:- % Done:

100%

Category:Unit/Functional Tests Spent time: -
Target version:6.2.0
TYPO3 Version:6.2 Complexity:easy
PHP Version:5.4 Sprint Focus:

Associated revisions

Revision 2d05837d
Added by Christian Kuhn over 1 year ago

[TASK] Reduce memory footprint of unit tests

Running the whole unit test suite on cli can eat up a significant
amount of memory. Most of that can not be mitigated due to phpunit
itself, but we can at least hint the PHP garbage collection by
unsetting test class properties in tearDown().

The patch introduces a generic tearDown() method that reflects the
test class and unsets all temporary properties of the class. In
effect, tests do not need to take care of unsetting properties.

The patch removes all tearDown() methods that only unset() stuff
and keeps others that do additional things but adds a call to
parent::tearDown(). Private properties are changed to protected,
so parent::tearDown can reach them. The additional computing
effort of the reflection is insignificant, the suite is nearly as
fast as before.

Results:
php 5.3: 1056MB -> 851MB
php 5.4: 870MB -> 670MB
php 5.5.: 876MB -> 674MB

Resolves: #55850
Related: #51436
Releases: 6.2
Change-Id: Ie665c53a3ab35e4808677e483d2099e0511c393f
Reviewed-on: https://review.typo3.org/27528
Reviewed-by: Helmut Hummel
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

History

#1 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27528

#2 Updated by Christian Kuhn over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF