Describe the bug
When starting WP Cypress on a project with a lot of plugins, I have hit an issue where the PHP memory limit is exceeded, resulting in the CLI process exiting.
This appears to occur despite configuring the PHP memory limit to a higher level in cypress.config.js, ref #78.
Tracing the issue back, it appears that the memory limit of 64M defined in php.ini, is being utilised for some time prior to the memory limit defined in the config.
Therefore, increasing the memory limit in the config has no impact in some situations, although it may resolve other issues where memory is exhausted later in the process.
Also related #54
To Reproduce
This may be difficult to replicate as the specific combination of plugins in use on your project will all contribute to the memory being used.
Steps to reproduce the behavior:
Create a project with many active plugins
Run WP Cypress npx wp-cypress start
Expect to see the PHP memory limit issue
Increase PHP memory limit in cypress.config.js ref #78
Run WP Cypress npx wp-cypress start
Expect to see the same PHP memory limit issue
To work around this we can:
Add configFile: '/wp-cypress-config.php' to wp config in cypress.config.js
Create wp-cypress.config.php with <?php ini_set('memory_limit','256M');
Re-run WP Cypress
Notice the memory limit has increased and initialisation issue is not hit
Expected behavior
When the PHP memory limit is increased, this should raise the limit during initialisation too.
Desktop (please complete the following information):
Describe the bug When starting WP Cypress on a project with a lot of plugins, I have hit an issue where the PHP memory limit is exceeded, resulting in the CLI process exiting.
This appears to occur despite configuring the PHP memory limit to a higher level in
cypress.config.js
, ref #78.Tracing the issue back, it appears that the memory limit of
64M
defined in php.ini, is being utilised for some time prior to the memory limit defined in the config.Therefore, increasing the memory limit in the config has no impact in some situations, although it may resolve other issues where memory is exhausted later in the process.
Also related #54
To Reproduce This may be difficult to replicate as the specific combination of plugins in use on your project will all contribute to the memory being used.
Steps to reproduce the behavior:
npx wp-cypress start
cypress.config.js
ref #78npx wp-cypress start
To work around this we can:
configFile: '/wp-cypress-config.php'
towp
config incypress.config.js
wp-cypress.config.php
with<?php ini_set('memory_limit','256M');
Expected behavior When the PHP memory limit is increased, this should raise the limit during initialisation too.
Desktop (please complete the following information):