Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Memory limit exceeded during initialisation #130

Open
g-elwell opened this issue Nov 9, 2023 · 0 comments
Open

PHP Memory limit exceeded during initialisation #130

g-elwell opened this issue Nov 9, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@g-elwell
Copy link
Member

g-elwell commented Nov 9, 2023

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:

  1. Create a project with many active plugins
  2. Run WP Cypress npx wp-cypress start
  3. Expect to see the PHP memory limit issue
  4. Increase PHP memory limit in cypress.config.js ref Add php memory limit to config #78
  5. Run WP Cypress npx wp-cypress start
  6. Expect to see the same PHP memory limit issue

To work around this we can:

  1. Add configFile: '/wp-cypress-config.php' to wp config in cypress.config.js
  2. Create wp-cypress.config.php with <?php ini_set('memory_limit','256M');
  3. Re-run WP Cypress
  4. 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):

  • OS: MacOs
  • wp-cypress: 0.11.1
  • cypress: 10.3.0
  • cypress browser: N/A
@g-elwell g-elwell added the bug Something isn't working label Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant