InterNations / http-mock

Mock HTTP requests on the server side in your PHP unit tests
http://www.internations.org
MIT License
390 stars 62 forks source link

PHPUnit failing #3

Closed maxenglander closed 10 years ago

maxenglander commented 10 years ago

I've done

git clone git@github.com:InterNations/http-mock.git
cd http-mock
composer install
phpunit

And am getting tons of failures, all along the lines of:

5) InterNations\Component\HttpMock\Tests\PHPUnit\HttpMockPHPUnitIntegrationTest::testLimitDurationOfAResponse Guzzle\Http\Exception\CurlException: [curl] 52: Empty reply from server [url] http://localhost:28080/_all

~/dev/http-mock/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php:420 ~/dev/http-mock/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php:354 ~/dev/http-mock/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php:286 ~/dev/http-mock/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php:247 ~/dev/http-mock/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php:140 ~/dev/http-mock/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMultiProxy.php:106 ~/dev/http-mock/vendor/guzzle/guzzle/src/Guzzle/Http/Client.php:385 ~/dev/http-mock/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php:258 ~/dev/http-mock/src/InterNations/Component/HttpMock/Server.php:97 ~/dev/http-> mock/src/InterNations/Component/HttpMock/PHPUnit/HttpMockFacade.php:76 ~/dev/http-mock/src/InterNations/Component/HttpMock/PHPUnit/HttpMockTrait.php:26 ~/dev/http-mock/tests/InterNations/Component/HttpMock/Tests/PHPUnit/HttpMockPHPUnitIntegrationTest.php:24

I'm running PHP 5.4.11 and have curl extension installed. Do you have any idea what the issue might be?

Thanks!

lstrojny commented 10 years ago

I am guessing it could be some kind of a networking issue. What platform are you on?

maxenglander commented 10 years ago

System

$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu Trusty Tahr (development branch) Release: 14.04 Codename: trusty

PHP

$ php -v PHP 5.4.11 (cli) (built: Feb 27 2014 04:02:30) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

Interestingly, I built and tried PHP 5.5.9, and the test suite passed. I also tried 5.4.23, and that failed.

From what I can tell, on 5.4.* (at least for me), when Server::clean() is called, the first call to the server process succeeds, but then the server process dies, so the second call fails.

I'll continue to try to debug this.

maxenglander commented 10 years ago

I take part of what I said back. I didn't try 5.4.23..I actually installed 5.4.25, and never actually tested it (I only thought I had). I just tested it now, and it passed. Will continue looking into 5.4.11. This wouldn't be a big deal for me except I'd really like to use this tool, but my company is currently stuck on 5.4.11.

maxenglander commented 10 years ago

I rebuilt 5.4.11 with curl built in, instead of adding it after as an extension. After doing so the test suite passed. I'm going to close this, thanks for your reply and the great tool!