PhpUnit + Xdebug slow and weird
PhpUnit tests are running extremely slows with xdebug enabled.
This has been documented a few times.
If I execute a test with “Run testName” - it's slow (14s)
BUT
If I run it with debug and no breakpoints with “Debug testName” - it's fast (2s)
Why is this? It boggles the mind.
Is there a way to set the configuration to run unit tests with xdebug disabled, but debug tests with xdebug enabled?
Please sign in to leave a comment.
Hi,
Unfortunately, there is no way to configure different settings for “Run” and “Debug” actions when it comes to the specific run configuration. However, the main difference with the “Debug” action is that it adds `-dxdebug.mode=debug` to the execution line thus using it on demand.
This is strange.
Could you please try one thing? It is pretty simple, just add the `-dxdebug.mode=off` in the ‘Interpreter options’ section of a test run configuration:
Would it be faster?
Well, it seems I can't reproduce the issue anymore.
Not sure what was going there. Maybe it was an issue with Chrome.
Tests are now running more or less the same speed, whether debugging or not.