-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Process] fix for Process:isSuccessful() #8801
Conversation
$this->assertFalse($process->isSuccessful()); | ||
usleep(300000); | ||
} | ||
|
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.
In this case I'd rather add a new test case, revealing the bug, instead of modifying an existing one.
👍 on adding a new test case. We also must ensure that the exitcode we catch is an int. I suspect that if the comparison was with a simple |
In case of |
last but not least, I think this PR should be open against 2.2 |
Exit code is an int https://github.com/php/php-src/blob/master/ext/standard/proc_open.c#L384 |
New unit test case added. I'm afraid if we throw an exception in isSuccessful() it would be a BC, i would rebase this PR to 2.2 and if you like i would create another PR and put a throw in this method. |
Be careful, the exitcode might be caught by @fabpot, @stof, do you consider throwing a |
Throwing an exception is a BC break. I think it makes sense to throw an exception on a running / non-run process , but this needs to be done on master instead. |
Replaced with #8815 |
If you call isSuccessful() on a running process you would get true because of 0 == null. I think that is not the expected behavior and that is not what phpdoc @return block said so.
This PR fixes another phpunit failure on testCheckTimeoutOnStartedProcess