-
-
Notifications
You must be signed in to change notification settings - Fork 861
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
Certain TypeInferenceTestCase
assert types take forever in PHPUnit 11
#10757
Comments
This bug report is missing a link to reproduction at phpstan.org/try. It will most likely be closed after manual review. |
Could you provide a repo with a reproducer ? |
If needed, sure. |
There is the repo. Interestingly, it turns out to be more complicated - if I leave just the test case I mentioned, it is not slow. So it seems to be related to all the tests being in the same place. Just do |
I will have a look when time allows. thank you |
Looks like PHPUnit 11 does something suboptiomal with data providers again. On PHPUnit 10 it's instant. |
Yes, it is instant, I can confirm. |
You could just change the recommendation of how to create unit tests for type assertions and leave it at that. |
You're using PHPStan test case correctly, this is the recommended way. Anyway, this rings a bell, I feel like we already fixed this once in PHPUnit. |
I have had issues with their |
I have the same feeling |
I did propose to write a new exporter system :-) If he agrees, I'd welcome ideas on how to export the data in PHPStan's case though, if that's alright with you. Or, since I'll probably try implementing the factory pattern ( |
Fixed the performance problem with PHPUnit 11: phpstan/phpstan-src@da87a65 |
So when the new version is out I can revert to using data providers? |
Yes, your example repository is fast again. |
I have to say, the level of your involvement makes me really happy. I've been using Phpstan for over 4 years now and I am really happy with it. Especially if I can write an extension to deal with edge cases and my own insanity. |
I'm glad to hear that 😊 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
Preface: I know it is not a bug, but it is still a problem.
I upgraded today to PHPUnit 11. I have an extension that provides the return types of
$this->prophesize(...)
expressions which has test cases. One of the test cases - this one...... causes serveral minutes delay in test execution. I traced it down to
vendor/phpunit/phpunit/src/Event/Value/Test/TestMethodBuilder.php
file and the statement on line 73...... and namely this bit -
$exporter->export($testCase->providedData()),
. I haven't looked at the specific data structure that is passed bygatherAssertTypes
for that test, but it is possibly so huge that the phpunit exporter is not able to deal with it. Frankly I am not sure why they are trying to export so early the whole data, but it is out of my control.One possible workaround is to rework the test like this...
... and that works, but I thought you'd want to know.
Code snippet that reproduces the problem
No response
Expected output
Not a bug really.
Did PHPStan help you today? Did it make you happy in any way?
Every day. I really like it, it makes me happy.
The text was updated successfully, but these errors were encountered: