8000 When tests fail, they leave external processes running (e.g.: hipache, redis, memcached, etcd) · Issue #195 · hipache/hipache · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

When tests fail, they leave external processes running (e.g.: hipache, redis, memcached, etcd) #195

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

Open
msabramo opened this issue Jan 4, 20 8000 15 · 3 comments

Comments

@msabramo
Copy link
Contributor
msabramo commented Jan 4, 2015

It seems that the tests don't clean up after themselves properly? At least perhaps when they fail?

Note that after the tests fail below, they have left hipache and memcached processes running.

[marca@marca-mac2 hipache]$ pgrep -fl hipache
[marca@marca-mac2 hipache]$ pgrep -fl memcached
[marca@marca-mac2 hipache]$ npm test

> hipache@0.4.0 test /Users/marca/dev/git-repos/hipache
> istanbul test _mocha --report html -- test/**/*.js --reporter spec --timeout 4000



  1) "before all" hook

  0 passing (4s)
  1 failing

  1)  "before all" hook:
     Uncaught Error: spawn ENOENT
      at errnoException (child_process.js:1011:11)
      at Process.ChildProcess._handle.onexit (child_process.js:802:34)



npm ERR! Test failed.  See above for more details.
[marca@marca-mac2 hipache]$ pgrep -fl hipache
57989 /usr/local/bin/node --expose-gc --always-compact -- ./bin/hipache -c test/fixtures/configs/hipache-config.json
57991 /usr/local/Cellar/node/0.10.35_1/bin/node --expose-gc --always-compact -- /Users/marca/dev/git-repos/hipache/bin/hipache -c test/fixtures/configs/hipache-config.json
57992 /usr/local/Cellar/node/0.10.35_1/bin/node --expose-gc --always-compact -- /Users/marca/dev/git-repos/hipache/bin/hipache -c test/fixtures/configs/hipache-config.json
[marca@marca-mac2 hipache]$ pgrep -fl memcached
57995 memcached -p 9001
57996 memcached -p 9002

Note that after the tests fail above, they have left hipache and memcached processes running.

If I run the tests again, they will fail because of these stray processes.

[marca@marca-mac2 hipache]$ npm test

> hipache@0.4.0 test /Users/marca/dev/git-repos/hipache
> istanbul test _mocha --report html -- test/**/*.js --reporter spec --timeout 4000



ERR! Server#./bin/hipache
ERR! Server#./bin/hipache
ERR! Server#./bin/hipache  events.js:72
ERR! Server#./bin/hipache
ERR! Server#./bin/hipache         throw er; // Unhandled 'error' event
ERR! Server#./bin/hipache               ^
ERR! Server#./bin/hipache events.js:72
ERR! Server#./bin/hipache         throw er; // Unhandled 'error' event
ERR! Server#./bin/hipache               ^
ERR! Server#./bin/hipache
ERR! Server#./bin/hipache  Error: bind EADDRINUSE
ERR! Server#./bin/hipache     at errnoException (net.js:905:11)
ERR! Server#./bin/hipache     at net.js:1085:30
ERR! Server#./bin/hipache     at Object.1:1 (cluster.js:594:5)
ERR! Server#./bin/hipache     at handleResponse (cluster.js:171:41)
ERR! Server#./bin/hipache     at respond (cluster.js:192:5)
ERR! Server#./bin/hipache     at handleMessage (cluster.js:202:5)
ERR! Server#./bin/hipache     at process.emit (events.js:117:20)
ERR! Server#./bin/hipache     at handleMessage (child_process.js:322:10)
ERR! Server#./bin/hipache     at child_process.js:396:7
ERR! Server#./bin/hipache     at process.handleConversion.net.Native.got (child_process.js:91:7)
...
@msabramo msabramo changed the title When tests fail, they leave memcached and hipache processes running When tests fail, they leave memcached, hipache, and redis-server processes running Jan 4, 2015
@msabramo
Copy link
Contributor Author
msabramo commented Jan 4, 2015

Ditto for redis-server:

[marca@marca-mac2 hipache]$ pgrep -fl redis
22379 /usr/local/opt/redis/bin/redis-server 127.0.0.1:6379
[marca@marca-mac2 hipache]$ npm test

> hipache@0.4.0 test /Users/marca/dev/git-repos/hipache
> istanbul test _mocha --report html -- test/**/*.js --reporter spec --timeout 4000



  1) "before all" hook

  0 passing (4s)
  1 failing

  1)  "before all" hook:
     Uncaught Error: spawn ENOENT
      at errnoException (child_process.js:1011:11)
      at Process.ChildProcess._handle.onexit (child_process.js:802:34)



npm ERR! Test failed.  See above for more details.
[marca@marca-mac2 hipache]$ pgrep -fl redis
22379 /usr/local/opt/redis/bin/redis-server 127.0.0.1:6379
65544 redis-server *:7777
65552 redis-server *:7001
65554 redis-server *:7002
65555 redis-server *:7003

@msabramo
Copy link
Contributor Author
9019 msabramo commented Jan 5, 2015

Ditto for etcd:

❯ pgrep -fl 'memcache'; pgrep -fl 'redis-server'; pgrep -fl 'hipache'; pgrep -fl 'zookeeper'; pgrep -fl 'etcd'
44293 memcached -p 9001
44294 memcached -p 9002
44287 redis-server *:7777
44296 redis-server *:7001
44297 redis-server *:7002
44298 redis-server *:7003
44288 /usr/local/bin/node --expose-gc --always-compact -- ./bin/hipache -c test/fixtures/configs/hipache-config.json
44290 /usr/local/Cellar/node/0.10.35_1/bin/node --expose-gc --always-compact -- /Users/marca/dev/git-repos/hipache/bin/hipache -c test/fixtures/configs/hipache-config.json
44291 /usr/local/Cellar/node/0.10.35_1/bin/node --expose-gc --always-compact -- /Users/marca/dev/git-repos/hipache/bin/hipache -c test/fixtures/configs/hipache-config.json
34906 vim test/unit/driver-zookeeper.js +9
44292 etcd -bind-addr=127.0.0.1:8001 -addr=127.0.0.1:8001 -peer-bind-addr=127.0.0.1:8011 -peer-addr=127.0.0.1:8011

@msabramo msabramo changed the title When tests fail, they leave memcached, hipache, and redis-server processes running When tests fail, they leave external processes running Jan 5, 2015
@msabramo msabramo changed the title When tests fail, they leave external processes running When tests fail, they leave external processes running (e.g.: hipache, redis, memcached, etcd) Jan 5, 2015
@msabramo
Copy link
Contributor Author
msabramo commented Jan 5, 2015

Is this related to the fact that the process seems to exit right away when it hits the first error? I.e.: I don't see all the failures at once only the first one. Is there a way to get it to keep going on an error so that it can report all the test results and then clean up?

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

1 participant
0