Skip to content
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] More robustness and deterministic tests #17094

Merged
merged 1 commit into from Dec 23, 2015

Conversation

nicolas-grekas
Copy link
Member

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;
Copy link
Member Author

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?

Copy link
Contributor

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

Copy link
Member Author

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;';
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link added

@nicolas-grekas nicolas-grekas force-pushed the fix-process-test23 branch 5 times, most recently from 9f2559d to 5b1b962 Compare December 22, 2015 08:24
@@ -55,6 +61,9 @@ public function __construct($script, $cwd = null, array $env = null, $timeout =
*/
public function setPhpBinary($php)
{
if ('\\' !== DIRECTORY_SEPARATOR) {
$php = 'exec '.$php;
Copy link
Member Author

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

@romainneutron
Copy link
Contributor

Nice job

@romainneutron
Copy link
Contributor

👍

@fabpot
Copy link
Member

fabpot commented Dec 23, 2015

Thank you @nicolas-grekas.

@fabpot fabpot merged commit d1a178a into symfony:2.3 Dec 23, 2015
fabpot added a commit that referenced this pull request Dec 23, 2015
…-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
@nicolas-grekas nicolas-grekas deleted the fix-process-test23 branch December 23, 2015 07:03
$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';
Copy link
Member

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants