Skip to content

Commit

Permalink
Merge pull request #479 from mattbennett/trusty-fix
Browse files Browse the repository at this point in the history
Trusty fix
  • Loading branch information
mattbennett committed Oct 5, 2017
2 parents 286d141 + 52b4692 commit 770576d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ sudo: false
language: python

services:
- rabbitmq
- docker

before_install:
# start rabbitmq
- docker run -d --hostname rabbitmq --name rabbitmq -p 15672:15672 -p 5672:5672 -e RABBITMQ_DEFAULT_USER=guest -e RABBITMQ_DEFAULT_PASS=guest rabbitmq:3.6.6-management
# install toxiproxy
- mkdir $PWD/bin
- wget -O $PWD/bin/toxiproxy-server https://github.com/Shopify/toxiproxy/releases/download/v2.0.0/toxiproxy-server-linux-amd64
- chmod +x $PWD/bin/toxiproxy-server
- export PATH=$PATH:$PWD/bin/
# work around https://github.com/travis-ci/travis-ci/issues/7940
- sudo rm -f /etc/boto.cfg

addons:
apt_packages:
Expand Down
2 changes: 1 addition & 1 deletion nameko/testing/pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def web_config(empty_config):
port = find_free_port()

cfg = empty_config
cfg[WEB_SERVER_CONFIG_KEY] = str(port)
cfg[WEB_SERVER_CONFIG_KEY] = "127.0.0.1:{}".format(port)
return cfg


Expand Down
14 changes: 10 additions & 4 deletions test/test_queue_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from nameko.testing.utils import (
assert_stops_raising, get_extension, get_rabbit_connections
)
from nameko.utils.retry import retry


TIMEOUT = 5
Expand Down Expand Up @@ -344,10 +345,15 @@ def handle_message(self, body, message):

# no connections should remain for our vhost
vhost = rabbit_config['vhost']
connections = get_rabbit_connections(vhost, rabbit_manager)
if connections: # pragma: no cover
for connection in connections:
assert connection['vhost'] != vhost

@retry
def check_connections_closed():
connections = get_rabbit_connections(vhost, rabbit_manager)
if connections: # pragma: no cover
for connection in connections:
assert connection['vhost'] != vhost

check_connections_closed()


class TestHeartbeats(object):
Expand Down
5 changes: 5 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ deps =
pinned: werkzeug==0.11.11
pinned: wrapt==1.10.8

# we can't test eventlet>0.20.1 in our py27 CI environment until the fix
# in https://github.com/eventlet/eventlet/issues/401 is released
py27-latest: eventlet==0.20.1
py27-examples: eventlet==0.20.1

setenv =
branchcoverage: ENABLE_BRANCH_COVERAGE=1
examples: ENABLE_BRANCH_COVERAGE=1
Expand Down

0 comments on commit 770576d

Please sign in to comment.