-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Process] Add feature "wait until callback" to process class #27742
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
$outputs = array( | ||
'First iteration output', | ||
'Second iteration output', | ||
'One more iteration output', | ||
'This took more time', | ||
'This one was sooooo slow', | ||
); | ||
|
||
$iterationTime = 10000; | ||
|
||
foreach ($outputs as $output) { | ||
usleep($iterationTime); | ||
$iterationTime *= 10; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Won't this create an extremely slow test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test should end after 1s and 110ms of execution of this code. If a failure occurs, the timeout will be reached 60s after the start of the test. The process is long to end (but ends, for "security" purpose) to simulate the running of a daemon. It is stop by the test. Note: for some reason under windows it looks like this test takes 4s. No idea why and how. Any though about? Windows PHPUnit output on test process:
Here is an ugly fix suggestion. |
||
echo $output."\n"; | ||
} |
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.
Hey @Nek- ! Happy New Year! I'm a bit late to the party but… could you please explain what this magic number is about? I thought possible values would be 1 or 2, but I didn't expect 3… any pointers? I'm trying to investigate this failure: https://ci.appveyor.com/project/fabpot/symfony/builds/21320382#L1210
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.
This issue is not related to this condition (or doesn't look related to me). Basically, if you extend the timeout for windows only, it may fix the issue. It looks like windows is slooooooow (not that slower on my computer though) to execute a process.
But I can't remember why I used
$type !== 3
, sorry.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.
Not sure it has to do with Windows being slow, because if you look, there is the beginning of the output, and then the end of it, but the middle is missing 😅 :
The code of the test is pretty straightforward, that's why I'm starting to suspect the code might be at fault, maybe here or in
WindowsPipes
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.
3 seems to be the index of a pipe that will receive the last exit code, and indeed, does not seem to have much to do with the problem at hand because it is does not seem to be used on Windows.