Skip to content

Fix memory leak in DrupalSetup

Moshe Weitzman requested to merge rbayliss:rbayliss-patch-1 into master

Created by: rbayliss

I've got about 15 test classes running on ExistingSiteTestCase, and we're starting to see memory limit issues running the tests. I did some profiling and discovered that we've got a memory leak due to the entities that have been marked for cleanup, and the Kernel not being shut down properly. In other words, the entities and full Drupal container are being retained as properties of the test class even after tearDown has been invoked. This PR resets the cleanupEntities array and shuts down the Kernel.

Merge request reports

Loading