Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Simpletest has a hardcode minimum memory of 320mb! Due to #2422019: Don't use reflection for parsing test annotations this is not necessary.
Proposed resolution
- Reduce recommended memory for simpletest to 192M.
- Fix run-tests.sh to run PHPUnit tests in forked processes. This means that the parent test-runner does not use lots of memory.
- Fix abstract MTimeProtectedFileStorageBase to allow concrete implementations to run in parallel
Following these changes the only test that requires more the 128M is Drupal\migrate_drupal\Tests\d6\MigrateDrupal6Test
. it needs around 130M. This is not surprising since this collects all the d6 migration tests and runs them together.
Remaining tasks
Review
Commit
User interface changes
None
API changes
None
Beta phase evaluation
Issue category | Task because nothing is currently borken. |
---|---|
Unfrozen changes | Unfrozen because it only changes tests and code that runs tests. |
Disruption | None |
Comment | File | Size | Author |
---|---|---|---|
#27 | 2422745.26.patch | 3.66 KB | alexpott |
#27 | 24-26-interdiff.txt | 797 bytes | alexpott |
#24 | 2422745.24.patch | 3.66 KB | alexpott |
#10 | 2422745.10.patch | 4.1 KB | alexpott |
#8 | 2422745.7.patch | 1.1 KB | alexpott |
Comments
Comment #1
alexpottLet's see what breaks at 128mb
Comment #3
alexpottSo only two tests fail at 128M!!!!
Drupal\migrate_drupal\Tests\d6\MigrateDrupal6Test
- not that surprising given that it is a meta test.Drupal\Tests\Core\Entity\EntityManagerTest
- a PHPUnit test!Increasing to 192M to see if that is enough.
Comment #4
alexpottI think EntityManagerTest is only failing in #1 due to the way we run PHPUnit tests in run-tests.sh.
The attached patch speeds up running the PHPUnit tests by 30 seconds with a concurrency of 8. Atm a PHPUnit test is a blocking :)
Comment #5
alexpottIn
MTimeProtectedFileStorageBase
we can't use vfsStream because tempnam() is not supported https://github.com/mikey179/vfsStream/wiki/Known-Issues. Imo this is a bit of a dodgy unit test because it is changing stuff in the temporary file system.Comment #8
alexpottProper 192M patch.
Comment #10
alexpottAh... a proper 192M patch.
Comment #11
alexpottWe need to fix the phpunit tests to run in a forked process because running them in the test runner process takes memory.
Comment #13
YesCT CreditAttribution: YesCT commentedwe have a bunch of reduce memory related issues, but most (seem to be) around install. like #2289201: [Meta] Make drupal install and run within reasonable php memory limits so we can reset the memory requirements to lower levels
Comment #14
BerdirNice, I guess this means that phpunit tests run concurrent now, like other tests? Probably doesn't make much of a difference now, but if make KernelTestBaseV2 happen, it will..
Comment #24
alexpottPatch to review/commit.
Comment #25
alexpottComment #26
BerdirAre you sure that //test is correct?
Comment #27
alexpottDoh!
Comment #28
BerdirThanks, I think this is good to go then.
Comment #29
catchCommitted/pushed to 8.0.x, thanks!