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

running rcpt_to.routes test hangs without redis running on localhost #1290

Closed
chazomaticus opened this Issue Jan 6, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@chazomaticus
Contributor

chazomaticus commented Jan 6, 2016

I just pulled a fresh clone of haraka and tried to ./run_tests. I get the following error, after a timeout:

rcpt_to.routes
✔ rcpt_file - miss
✔ rcpt_file - hit
[Error: invalid STUN result]
✔ get_public_ip - normal

FAILURES: Undone tests (or their setups/teardowns): 
- rcpt_redis - miss

If I run just ./run_tests tests/plugins/rcpt_to.routes.js it just hangs after the first two tests pass.

After doing a little debugging, I'm seeing the error handler on the redis client (https://github.com/haraka/Haraka/blob/master/plugins/rcpt_to.routes.js#L166-L169) get called multiple times. The error message is Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED.

Is running a local redis server required to be able to run the tests (I'm not running one)? Is that error spurious, and I'm doing something else dumb?

@Dexus

This comment has been minimized.

Show comment
Hide comment
@Dexus

Dexus Jan 6, 2016

Member

Redis is a optional dep.

If no redis is running, the test will except 0 and call test done.

If you using plugins in live mode that need redis it will not work.

Can you give some more details to your test env? Nodejs Version, OS etc?

Am 06.01.2016 um 02:33 schrieb Charles Lindsay notifications@github.com:

I just pulled a fresh clone of haraka and tried to /run_tests I get the following error, after a timeout:

rcpt_toroutes
✔ rcpt_file - miss
✔ rcpt_file - hit
[Error: invalid STUN result]
✔ get_public_ip - normal

FAILURES: Undone tests (or their setups/teardowns):

  • rcpt_redis - miss
    If I run just /run_tests tests/plugins/rcpt_toroutesjs it just hangs after the first two tests pass

After doing a little debugging, I'm seeing the error handler on the redis client (https://githubcom/haraka/Haraka/blob/master/plugins/rcpt_toroutesjs#L166-L169) get called multiple times The error message is Redis connection to 127001:6379 failed - connect ECONNREFUSED

Is running a local redis server required to be able to run the tests (I'm not running one)? Is that error spurious, and I'm doing something else dumb?


Reply to this email directly or view it on GitHub.

Member

Dexus commented Jan 6, 2016

Redis is a optional dep.

If no redis is running, the test will except 0 and call test done.

If you using plugins in live mode that need redis it will not work.

Can you give some more details to your test env? Nodejs Version, OS etc?

Am 06.01.2016 um 02:33 schrieb Charles Lindsay notifications@github.com:

I just pulled a fresh clone of haraka and tried to /run_tests I get the following error, after a timeout:

rcpt_toroutes
✔ rcpt_file - miss
✔ rcpt_file - hit
[Error: invalid STUN result]
✔ get_public_ip - normal

FAILURES: Undone tests (or their setups/teardowns):

  • rcpt_redis - miss
    If I run just /run_tests tests/plugins/rcpt_toroutesjs it just hangs after the first two tests pass

After doing a little debugging, I'm seeing the error handler on the redis client (https://githubcom/haraka/Haraka/blob/master/plugins/rcpt_toroutesjs#L166-L169) get called multiple times The error message is Redis connection to 127001:6379 failed - connect ECONNREFUSED

Is running a local redis server required to be able to run the tests (I'm not running one)? Is that error spurious, and I'm doing something else dumb?


Reply to this email directly or view it on GitHub.

@chazomaticus

This comment has been minimized.

Show comment
Hide comment
@chazomaticus

chazomaticus Jan 6, 2016

Contributor
$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS"
$ uname -srvp
Linux 3.13.0-74-generic #118-Ubuntu SMP Thu Dec 17 22:52:10 UTC 2015 x86_64
$ /usr/bin/env node --version
v0.10.37
$ time ./run_tests tests/plugins/rcpt_to.routes.js 
Running tests:  [ 'tests/plugins/rcpt_to.routes.js' ]

rcpt_to.routes.js
✔ rcpt_file - miss
✔ rcpt_file - hit
^C

real    0m44.493s
user    0m0.234s
sys 0m0.013s

Running under strace shows a number of connections to 127.0.0.1:6379 being opened and quickly closed, then it'll wait a bit, then repeat. Doesn't seem to be doing anything else other than trying repeatedly to connect to redis.

Contributor

chazomaticus commented Jan 6, 2016

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS"
$ uname -srvp
Linux 3.13.0-74-generic #118-Ubuntu SMP Thu Dec 17 22:52:10 UTC 2015 x86_64
$ /usr/bin/env node --version
v0.10.37
$ time ./run_tests tests/plugins/rcpt_to.routes.js 
Running tests:  [ 'tests/plugins/rcpt_to.routes.js' ]

rcpt_to.routes.js
✔ rcpt_file - miss
✔ rcpt_file - hit
^C

real    0m44.493s
user    0m0.234s
sys 0m0.013s

Running under strace shows a number of connections to 127.0.0.1:6379 being opened and quickly closed, then it'll wait a bit, then repeat. Doesn't seem to be doing anything else other than trying repeatedly to connect to redis.

@msimerson

This comment has been minimized.

Show comment
Hide comment
@msimerson

msimerson Jan 11, 2016

Member

The introduction of redis to haraka's optionalDependencies section of package.json means that now, rcpt_to.routes detects that redis is installed and so consequently tries to use and test against it. I'll work on a PR to handle this better.

Member

msimerson commented Jan 11, 2016

The introduction of redis to haraka's optionalDependencies section of package.json means that now, rcpt_to.routes detects that redis is installed and so consequently tries to use and test against it. I'll work on a PR to handle this better.

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