简体   繁体   中英

Codeception in Yii2, every test in a row consume more memory

I am trying to test a class using Codeception in Yii2 advanced template. And it uses too much memory, when i run all the tests.

When i run tests separately they are fast and don't use much memory, they all take about 10 mb, which is ok for me. But when i run them all, every test in a row uses more and more memory, and for example 6 tests use 645mb together.

I suppose they don't clean memory somehow. How do i clean memory after each test?

It happened after codeception update, to 2.1.

Found the problem. I used Codeception/Specify blocks, which deep cloned everything.

I disabled cloning by default, setting the following in _bootstrap.php \\Codeception\\Specify\\Config::setDeepClone(false);

More info can be found in the docs: https://github.com/Codeception/Specify#global-configuration

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM