Skip to content

Instantly share code, notes, and snippets.

@romainneutron
Last active August 29, 2015 13:57
Show Gist options
  • Save romainneutron/9544313 to your computer and use it in GitHub Desktop.
Save romainneutron/9544313 to your computer and use it in GitHub Desktop.
Feedback about Symfony/Process on Windows

Hi everybody,

We have an issue in Symfony Process for a long time : Process::start is blocking on Windows. It's a tricky issue and it would be awesome that we could fix this. I've proposed a patch, unfortunately it seems it does not solve the issue on all setups.

I got three different Windows implementations for Symfony/Process on Windows platform. All of them are working for me and solve the bug, but it seems some of them are failing on some installs.

I need help and if you can run the Process test suite and give feedback with the following template in this gist comments:

| Q               | A
| --------------- | ---
| branch name     | [fix-windows|fix-windows-alternate-1|fix-windows-alternate-2]
| PHP version     | 5.5.10
| Test suite ends | [yes|no, it hangs]

How to run the test suites?

First, fetch my sources :

git clone https://github.com/romainneutron/symfony.git
cd symfony
composer install

Then run tests for each of the three branches :

git checkout -b fix-windows -t origin/fix-windows
phpunit src/Symfony/Component/Process/
git checkout -b fix-windows-alternate-1 -t origin/fix-windows-alternate-1
phpunit src/Symfony/Component/Process/
git checkout -b fix-windows-alternate-2 -t origin/fix-windows-alternate-2
phpunit src/Symfony/Component/Process/
@stof
Copy link

stof commented Mar 14, 2014

These instructions won't work properly (the phpunit config in the component expects the component to be the root composer package, while it is not what you documented). the proper way is phpunit src/Symfony/Component/Process/

@romainneutron
Copy link
Author

Thanks @stof, I updated the gist

@tgarbiak
Copy link

Also if git checkout fix-windows origin/fix-windows doesn't work (wasn't for me) try git checkout -b fix-windows -t origin/fix-windows

Q A
branch name fix-windows
PHP version 5.5.6
Test suite ends yes
Q A
branch name fix-windows-alternate-1
PHP version 5.5.6
Test suite ends yes
Q A
branch name fix-windows-alternate-2
PHP version 5.5.6
Test suite ends yes

2 failures (in all of the above):

1) Symfony\Component\Process\Tests\PhpProcessTest::testNonBlockingWorks
Failed asserting that null matches expected 'hello world!'.

(...)symfony\src\Symfony\Component\Process\Tests\PhpProcessTest.php:27

2) Symfony\Component\Process\Tests\SimpleProcessTest::testRunProcessWithTimeout
Failed asserting that 0.70538306236267 is less than 0.7

(...)symfony\src\Symfony\Component\Process\Tests\AbstractProcessTest.php:509

Windows 8.1

@maoueh
Copy link

maoueh commented Mar 14, 2014

Q A
branch name fix-windows
PHP version 5.3.28
Test suite ends yes
Q A
branch name fix-windows-alternate-1
PHP version 5.3.28
Test suite ends yes
Q A
branch name fix-windows-alternate-2
PHP version 5.3.28
Test suite ends yes

No failures on my side, only skipped tests. Ran on Windows 7 Professional 64bits.

@romainneutron
Copy link
Author

Thanks for your feedback @maoueh and @tgarbiak

@tgarbiak : is it always failing ? randomly ?

@maryo
Copy link

maryo commented Mar 15, 2014

Q A
branch name fix-windows
PHP version 5.5.6
Test suite ends no, it hangs
Q A
branch name fix-windows-alternate-1
PHP version 5.5.6
Test suite ends yes
Q A
branch name fix-windows-alternate-2
PHP version 5.5.6
Test suite ends no, it hangs

All of them failed on 1) Symfony\Component\Process\Tests\PhpProcessTest::testNonBlockingWorks
(Those two didn't finish but had Fail at the beginning)

Always getting the same result. I run those tests from command line as an administrator.

Microsoft Windows [Version 6.3.9600]
I think it is 8.1 RTM, 64bit. Can try it at work again on another PC on monday.

@tgarbiak
Copy link

Sorry for late reply - yes, failing all the time.

@tgarbiak
Copy link

Run it on different machine.

Q A
branch name fix-windows
PHP version 5.4.16
Test suite ends yes

4 failures, different though (all about wrong escaping)

Q A
branch name fix-windows-alternate-1
PHP version 5.4.16
Test suite ends yes

No failures.

Q A
branch name fix-windows-alternate-2
PHP version 5.4.16
Test suite ends yes

No failures.

Windows 8.1

@sstok
Copy link

sstok commented Apr 9, 2014

Q A
branch name fix-windows
PHP version 5.4.27
Test suite ends no, it hangs
Q A
branch name fix-windows-alternate-1
PHP version 5.4.27
Test suite ends no, it hangs
Q A
branch name fix-windows-alternate-2
PHP version 5.4.27
Test suite ends no, it hangs
Q A
branch name master (latest updates)
PHP version 5.4.27
Test suite ends no, it hangs

I'm using ConEmu with the Git Shell.

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