-
Notifications
You must be signed in to change notification settings - Fork 509
PHPUnit 11 #4057
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
PHPUnit 11 #4057
Conversation
I might have some time later this week to look into it |
These kinds of changes work: 7389a6d So PHPUnit is once again not handling passing huge objects from data providers to test methods. Scope contains class reflection and that will be hard to serialize. |
If you're going to try to improve PHPUnit, do it on one commit before that one :) |
Even if I update/remove tests that cause memory exhaustion, the whole test suite is still several times slower than before 🙁 This really needs to be solved in PHPUnit. |
is this the same problem we discussed once in phpstan/phpstan#9914 ? Blackfire Profile of PHPUnit 11 with |
btw: did you try whether phpunit 12 has the same problem? |
Changing $testData[] = DataFromDataProvider::from(
$dataSetName,
- Exporter::export($testCase->providedData()),
+ Exporter::shortenedRecursiveExport($testCase->providedData()),
$testCase->dataSetAsStringWithData(),
); turns
into
.. still looking into it.. |
with the above patch the test-suite is working for me again: ddde40e with PHPUnit 11.x
vs 5b4bf80 with PHPUnit 10.x
wdyt? |
Fix landed in sebastianbergmann/phpunit@7ff0969 For PHPUnit 11.5.x and newer released https://github.com/sebastianbergmann/phpunit/releases/tag/11.5.23 tested locally with 11.5.23 and can confirm the fix |
Thank you! |
Maybe this test matrix generation needs updating? https://github.com/phpstan/phpstan-src/actions/runs/15630379293/job/44033085940?pr=4057 |
Can have a look later today |
the xml format generated by I am looking into adjusting the script drive by observation: running has a bottleneck on ![]() https://blackfire.io/profiles/2f4cb6e1-e2a5-4455-881f-e2eeff149dbe/graph not sure this is expected |
please try this fix: staabm@d024500 |
Trying it now. BTW you can submit PRs against (based on) other branches too, which would cause it being merged into this PR 😊 |
This pull request has been marked as ready for review. |
On my computer: PHPUnit 11: Time: 00:52.399, Memory: 432.00 MB Awesome! 👏 |
And as expected, we're not the only ones benefiting from that: https://x.com/spudley99/status/1933485562025128390 |
/cc @staabm PHPUnit crashes with:
Maybe there's an opportunity for optimization. Could you look into it and maybe contribute a fix to PHPUnit? Thanks!