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

Issues running "composer test" #152

Open
jimmyadaro opened this issue Mar 5, 2017 · 1 comment
Open

Issues running "composer test" #152

jimmyadaro opened this issue Mar 5, 2017 · 1 comment

Comments

@jimmyadaro
Copy link

Hi there;
I've been with this problem almost all night.

Let me explain my current situation: I'm trying to set PHP-RQL using XAMPP (7.1.1-0) @ Ubuntu 16.04(.4) using PHP 7(.0.15) (cli). I've installed Composer (1.3.2 2017-01-27) and PHPUnit (6.0.8).

I tried set up the port 28015 with this command:

sudo nc -l 28015

I guess that work as expected; that port does nothing until I go to the directory where I've all the .ZIP content of the MASTER branch, this dir is: /opt/lampp/htdocs/rql and execute the following command:

composer test

Then the Terminal where I have the nc command throws something like this:

ý�4{"protocol_version":0,"authentication_method":"SCRAM-SHA-256","authentication":"n,,n=admin,r=PPTNpWBA1a166N4lZm9\/DoXx"}

Then the composer test Terminal outputs this:

tests/phpunit.sh
PHP Fatal error: Uncaught RqlDriverError:
Unable to read from socket during handshake. Disconnected.

thrown in /opt/lampp/htdocs/rql/rdb/Connection.php on line 490
PHPUnit 4.8.35 by Sebastian Bergmann and contributors.

EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 63 / 395 ( 15%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 126 / 395 ( 31%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 189 / 395 ( 47%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 252 / 395 ( 63%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 315 / 395 ( 79%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 378 / 395 ( 95%)
EEEEEEEEEEEEEEEEE

Time: 161 ms, Memory: 14.00MB

There were 395 errors:

  1. r\Tests\Functional\AggregationsTest::testReduce
    stream_socket_client(): unable to connect to tcp://127.0.0.1:28015 (Connection refused)

/opt/lampp/htdocs/rql/rdb/Connection.php:455
/opt/lampp/htdocs/rql/rdb/Connection.php:118
/opt/lampp/htdocs/rql/rdb/global.php:87
/opt/lampp/htdocs/rql/tests/TestCase.php:20
/opt/lampp/htdocs/rql/tests/TestCase.php:11

  1. r\Tests\Functional\AggregationsTest::testCountVal
    stream_socket_client(): unable to connect to tcp://127.0.0.1:28015 (Connection refused)

/opt/lampp/htdocs/rql/rdb/Connection.php:455
/opt/lampp/htdocs/rql/rdb/Connection.php:118
/opt/lampp/htdocs/rql/rdb/global.php:87
/opt/lampp/htdocs/rql/tests/TestCase.php:20
/opt/lampp/htdocs/rql/tests/TestCase.php:11

  1. r\Tests\Functional\AggregationsTest::testCountRow
    stream_socket_client(): unable to connect to tcp://127.0.0.1:28015 (Connection refused)

/opt/lampp/htdocs/rql/rdb/Connection.php:455
/opt/lampp/htdocs/rql/rdb/Connection.php:118
/opt/lampp/htdocs/rql/rdb/global.php:87
/opt/lampp/htdocs/rql/tests/TestCase.php:20
/opt/lampp/htdocs/rql/tests/TestCase.php:11

  1. r\Tests\Functional\AggregationsTest::testDistinct
    stream_socket_client(): unable to connect to tcp://127.0.0.1:28015 (Connection refused)

/opt/lampp/htdocs/rql/rdb/Connection.php:455
/opt/lampp/htdocs/rql/rdb/Connection.php:118
/opt/lampp/htdocs/rql/rdb/global.php:87
/opt/lampp/htdocs/rql/tests/TestCase.php:20
/opt/lampp/htdocs/rql/tests/TestCase.php:11

[AND THEN ANOTHER HUNDREDS OF "stream_socket_client(): unable to connect to tcp://127.0.0.1:28015 (Connection refused)"]

FAILURES!
Tests: 395, Assertions: 0, Errors: 395.
PHP Warning: stream_socket_client(): unable to connect to tcp://127.0.0.1:28015 (Connection refused) in /opt/lampp/htdocs/rql/rdb/Connection.php on line 455
PHP Fatal error: Uncaught RqlDriverError:
Unable to connect: Connection refused

thrown in /opt/lampp/htdocs/rql/rdb/Connection.php on line 459
Script tests/phpunit.sh handling the test event returned with error code 2

If I execute netstat -atn I can see this:

tcp 0 0 127.0.0.1:43368 127.0.0.1:28015 ESTABLISHED
tcp 0 0 127.0.0.1:28015 127.0.0.1:43368 ESTABLISHED

until the tests/phpunit.sh file is executed (and throw all those errors), then this disappears:

tcp 0 0 127.0.0.1:28015 127.0.0.1:43368 ESTABLISHED

and only have this remaining:

tcp 0 0 127.0.0.1:43368 127.0.0.1:28015 TIME_WAIT

Changing the line 459 of rdb/Connection.php to this:

throw new RqlDriverError("Unable to connect: " . $errstr." Host: ".$this->host." Port: ".$this->port." Errno: ".$errno);

I get this error after run composer test:

Unable to connect: Connection refused Host: 127.0.0.1 Port: 28015 Errno: 111

and http://localhost/rql/tests/TestCase.php shows this:

Fatal error: Class 'PHPUnit_Framework_TestCase' not found in /opt/lampp/htdocs/rql/tests/TestCase.php on line 5

What am I doing wrong? Maybe I do need to install something else? Maybe PHP 7 is not supported yet?

@Geekimo
Copy link

Geekimo commented Dec 24, 2017

Maybe you should have a running rethinkdb server installed on the host where you're running the tests.
The errors are trigerred regarding a faulty connection to a server.

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

No branches or pull requests

2 participants