phpunit icon indicating copy to clipboard operation
phpunit copied to clipboard

Configure global exception/error handlers checks

Open soyuka opened this issue 1 year ago • 1 comments

This makes https://github.com/sebastianbergmann/phpunit/pull/5619 configurable and potentially mitigates https://github.com/symfony/symfony/issues/53812#issuecomment-2204410941. On one hand I agree that not releasing error_handlers is probably a mistake, on the other it's cpu intensive to add/remove handlers and is something that you should be able to disable.

Let me know your thought, I'm not sure how this is tested on the phpunit code base and I didn't wanted to do too much in case this is a bad idea, thanks!

soyuka avatar Jul 03 '24 08:07 soyuka

Do you think I should fix the tests and rebase this @sebastianbergmann or we should close?

soyuka avatar Apr 08 '25 13:04 soyuka

@soyuka could you describe what your motivation is for this change? what is the actual root issue?

https://github.com/symfony/symfony/issues/53812#issuecomment-2204410941 does not describe the problem but only possible solutions

On one hand I agree that not releasing error_handlers is probably a mistake, on the other it's cpu intensive to add/remove handlers and is something that you should be able to disable.

this sounds like you are trying to fix a performance problem. if so, do you have numbers to proof that?

not restoring global state after a test might lead to random looking side-effects in followup tests

staabm avatar Aug 08 '25 09:08 staabm

I thought it'd be a good idea to be able to configure this feature but if no one needs this it's probably useless.

Feel free to close this.

soyuka avatar Aug 08 '25 11:08 soyuka

I am fine with making things configurable in case someone has a use-case for it. if we don't have a concrete use-case I would close it, as it makes PHPUnit more complicated for no gain.

just my personal opinion though

staabm avatar Aug 08 '25 12:08 staabm

Thank you for your contribution. I appreciate the time you invested in preparing this pull request. However, I have decided not to merge it.

sebastianbergmann avatar Aug 11 '25 13:08 sebastianbergmann