-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Values used in assertions are exported for Test\AssertionSucceeded events #5183
Comments
I can confirm this can have a huge impact: on my biggest project exporting |
I have to say that I am surprised that this has such a huge impact, simply because I have never used assertions on object graphs so large that exporting them became noticably expensive. |
The most recurring use case for me is where you have a variable that might be an $myBigObject = getMyBigObjectOrNull();
self::assertNotNull($myBigObject);
self::assertTrue($myBigObject->active()); // And so on I have a hundred of snippets like this in my test folder. |
Thank you, @muzcb and @Slamdunk for bringing this to my attention! With the changes in c2fcb8f, we no longer export values used in assertions to emit the |
Thank you very much for your support @sebastianbergmann |
After this change PhpUnit 10 is actually faster than 9.5 or 9.6 for us. Before this change test suite took around 8 minutes with PhpUnit 10, now after this it took only under 2 minutes. with 9.6/9.5 it takes about 3 minutes. |
@sakarikl That is good to hear, thanks! It is also surprising to hear, as PHPUnit 10 "does more" (event system) than PHPUnit 9, so I have to wonder where this improvement is coming from. |
Only change for us was using attributes instead of phpdoc (in covers and dataprovider) and changing data providers to statics. |
oh. and paratest was also updated from 6 to 7. Those were all run with WrapperRunner with 4 processes. |
Since PHPUnit 10, all assertion results will be handed to
DispatchingEmitter
, which in turn will calleach time, including for succeeded assertions. If the values can be complex object graphs (similar to those described in issue #4965) that will cause the memory usage and runtime to multiply.
The text was updated successfully, but these errors were encountered: