-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Process] More robustness and deterministic tests #17094
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
Conversation
nicolas-grekas
commented
Dec 21, 2015
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #16988, #15617 |
License | MIT |
Doc PR | - |
@@ -46,6 +46,9 @@ public function __construct($script, $cwd = null, array $env = null, $timeout = | |||
$php .= ' '.ProcessUtils::escapeArgument($file); | |||
$script = null; | |||
} | |||
if ('\\' !== DIRECTORY_SEPARATOR) { | |||
$php = 'exec '.$php; |
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.
OK for this as bug fix?
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.
yes, but please add a comment explaning what's this / link to existing issues
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.
comment added
|
||
$ptsWorkaround = null; | ||
$commandline .= '{ ('.$this->commandline.') <&3 3<&- 3>/dev/null & } 3<&0;'; |
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.
could you add the link to the stackoverflow post explaining this command line?
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.
link added
9f2559d
to
5b1b962
Compare
@@ -55,6 +61,9 @@ public function __construct($script, $cwd = null, array $env = null, $timeout = | |||
*/ | |||
public function setPhpBinary($php) | |||
{ | |||
if ('\\' !== DIRECTORY_SEPARATOR) { | |||
$php = 'exec '.$php; |
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.
i'm going to remove this one because it breaks if anyone already prefix $php with exec
5b1b962
to
cdcd35d
Compare
cdcd35d
to
d1a178a
Compare
Nice job |
👍 |
Thank you @nicolas-grekas. |
…-grekas) This PR was merged into the 2.3 branch. Discussion ---------- [Process] More robustness and deterministic tests | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #16988, #15617 | License | MIT | Doc PR | - Commits ------- d1a178a [Process] More robustness and deterministic tests
$ptsWorkaround = null; | ||
// See https://unix.stackexchange.com/questions/71205/background-process-pipe-input | ||
$commandline .= '{ ('.$this->commandline.') <&3 3<&- 3>/dev/null & } 3<&0;'; | ||
$commandline .= 'pid=$!; echo $pid >&3; wait $pid; code=$?; echo x$code >&3; exit $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.
the old code had a p
prefix before the pid, which is not there anymore. Does it still work fine ?