Project

General

Profile

Actions

Task #103889

open

PHPunit functional tests persist to much memory - use tearDown for crucial cases

Added by Ayke Halder 24 days ago. Updated 20 days ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Code Cleanup
Target version:
-
Start date:
2024-05-23
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
13
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

There are some crucial cases:

# TYPO3\CMS\Frontend\Tests\Functional\ContentObject\FilesContentObjectTest
!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!. 5063 / 7862 ( 64%)
!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.
Memory leak: 102.10 MB

# TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\SecurityTest
............  854 / 7862 ( 10%)
..................................
Memory leak: 101.25 MB

# TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest
........... 2379 / 7862 ( 30%)
......................................
Memory leak: 73.90 MB

# TYPO3\CMS\Backend\Tests\Functional\Controller\MfaConfigurationControllerTest
!!!!.!!!!.   61 / 7862 (  0%)
!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.
Memory leak: 49.31 MB

# TYPO3\CMS\Extbase\Tests\Functional\Persistence\RelationTest
............. 3538 / 7862 ( 45%)
............................................................. 3599 / 7862 ( 45%)
............................
Memory leak: 54.30 MB

# TYPO3\CMS\Impexp\Tests\Functional\ExportTest
!!.!!.!!.!!.!!.!!.!!.!!.!!.!!.!!.!!.!!.!!.
Memory leak: 30.69 MB

Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Epic #103888: PHPunit functional tests persist to much memory - use tearDown etc. to fixNew2024-05-23

Actions
Actions #1

Updated by Ayke Halder 24 days ago

  • Related to Epic #103888: PHPunit functional tests persist to much memory - use tearDown etc. to fix added
Actions #2

Updated by Gerrit Code Review 24 days ago

  • Status changed from New to Under Review

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

Actions #3

Updated by Ayke Halder 24 days ago

There is a base memory usage for tests of ~55 MB. Multiple tests run in one test-run will reuse this data.

So getting a single test run down to Memory leak: ~55 MB is as good as it gets.

For reporting tool see:
https://github.com/TYPO3/testing-framework/issues/561


Before

$ ./Build/Scripts/runTests.sh -s functional -p 8.2 -d mariadb typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/SecurityTest.php 

# TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\SecurityTest
..............................................                    46 / 46 (100%)
Memory leak: 153.53 MB

Time: 00:08.623, Memory: 169.00 MB

OK (46 tests, 92 assertions)

After

# TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\SecurityTest
..............................................                    46 / 46 (100%)
Memory leak: 55.74 MB

Time: 00:09.414, Memory: 99.00 MB

OK (46 tests, 92 assertions)

Before

$ ./Build/Scripts/runTests.sh -s functional -p 8.2 -d mariadb typo3/sysext/frontend/Tests/Functional/ContentObject/FilesContentObjectTest.php

# TYPO3\CMS\Frontend\Tests\Functional\ContentObject\FilesContentObjectTest
!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.        58 / 58 (100%)
Memory leak: 154.66 MB

Time: 00:15.984, Memory: 169.00 MB

OK (58 tests, 58 assertions)

After

# TYPO3\CMS\Frontend\Tests\Functional\ContentObject\FilesContentObjectTest
..........................................................        58 / 58 (100%)
Memory leak: 54.64 MB

Time: 00:16.977, Memory: 97.00 MB

OK (58 tests, 58 assertions)

Before

$ ./Build/Scripts/runTests.sh -s functional -p 8.2 -d mariadb typo3/sysext/core/Tests/Functional/Imaging/IconFactoryTest.php

# TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest
.................................................                 49 / 49 (100%)
Memory leak: 126.33 MB

Time: 00:02.819, Memory: 141.00 MB

OK (49 tests, 57 assertions)

After

# TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest
.................................................                 49 / 49 (100%)
Memory leak: 55.75 MB

Time: 00:03.139, Memory: 101.00 MB

OK (49 tests, 57 assertions)

Before

$ ./Build/Scripts/runTests.sh -s functional -p 8.2 -d mariadb 

# TYPO3\CMS\Backend\Tests\Functional\Controller\MfaConfigurationControllerTest
!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.!!!!.                                            22 / 22 (100%)
Memory leak: 102.21 MB

Time: 00:03.727, Memory: 117.00 MB

OK (22 tests, 68 assertions)

After

# TYPO3\CMS\Backend\Tests\Functional\Controller\MfaConfigurationControllerTest
......................                                            22 / 22 (100%)
Memory leak: 56.75 MB

Time: 00:03.549, Memory: 99.00 MB

OK (22 tests, 68 assertions)

Before

$ ./Build/Scripts/runTests.sh -s functional -p 8.2 -d mariadb typo3/sysext/impexp/Tests/Functional/ExportTest.php

# TYPO3\CMS\Impexp\Tests\Functional\ExportTest
!!.!!.!!.!!.!!.!!.!!.!!.!!.!!.!!.!!.!!.!!.                                                    14 / 14 (100%)
Memory leak: 86.28 MB

Time: 00:05.008, Memory: 103.00 MB

OK (14 tests, 25 assertions)

After

# TYPO3\CMS\Impexp\Tests\Functional\ExportTest
!.!.!.!.!.!.!.!.!.!.!.!.!.!.                                                    14 / 14 (100%)
Memory leak: 58.77 MB

Time: 00:04.508, Memory: 103.00 MB

OK (14 tests, 25 assertions)
Actions #4

Updated by Gerrit Code Review 23 days ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84376

Actions #5

Updated by Gerrit Code Review 21 days ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84376

Actions #6

Updated by Gerrit Code Review 21 days ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84376

Actions #7

Updated by Gerrit Code Review 21 days ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84376

Actions #8

Updated by Gerrit Code Review 20 days ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84376

Actions #9

Updated by Gerrit Code Review 20 days ago

Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84376

Actions #10

Updated by Gerrit Code Review 20 days ago

Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84376

Actions

Also available in: Atom PDF