-
Notifications
You must be signed in to change notification settings - Fork 7.9k
POC run-tests.php: avoid SKIPIF evaluation in subprocesses #16664
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
base: master
Are you sure you want to change the base?
Conversation
Thank you for your proposal! I have a few concerns.
I'm not sure if this is a better approach, but an alternative idea might be to instead:
All in all, I'm somewhat skeptical whether this is something we need. With the latter approach, it may be easier to test how much of a difference it actually makes across all tests. If others have anything to add, please do. |
@@ -3611,7 +3611,13 @@ public function checkSkip(string $php, string $code, string $checkFile, string $ | |||
} | |||
|
|||
save_text($checkFile, $code, $tempFile); | |||
$result = trim(system_with_timeout("$php \"$checkFile\"", $env)); | |||
$useSubprocess = $testHasIniSection || shouldRunInSubprocess($code); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$php
is not necessarily the same as the currently running PHP binary. This should be handled accordingly.
@iluuu1994, it just occured to me that it might be possible to extend CLI to accept multiple scripts which are run as separate requests. I have no idea how much work would be needed, if that would work at all, and how badly this might be misused by others, though. |
@cmb69 I don't understand how multiple files as inputs to the CLI SAPI would with this issue. Can you elaborate? |
My idea was, that you would basically pass in:
Each of these would run as separate request consecutively (so wouldn't influence the state of the PHP interpreter, so side effects wouldn't matter, so no need to detect these upfront). We would avoid multiple PHP processes to start up for a single test. Now I see that this wouldn't work, since if skipif reports to skip, the others would be executed anyway. Unless we would bake in the relevant logic from run-tests.php, what seems to be a bad idea. We might consider to introduce a new SAPI for this purpose, though. But that wouldn't test the real CLI SAPI, so probably a bad idea anyway. |
as discussed in #16623 this PR implements a proof of concept.
created a rough prototype which main focus is to give an indication how much faster the test-suite can get by avoiding subprocesses running
php run-tests.php ext/intl/tests
.ext/intl/tests
only we can see ~2 seconds saved when running on macos.WITH THIS PR
BEFORE
Testing on windows with php 8.2.12 (NTS Visual C++ 2019 x64)
WITH THIS PR
BEFORE
next steps
update: searching php-src for
die\s*\(\s*.skip
yields ~ 3200 results (of which not all can be inlined, because of side-effects in skipif)die("skip xy")
cases, so tests don't need manual adjusting