I cloned the nameko repo recently and I am trying run the tests locally. I am however getting the following error all the time.
(env) travelling_devsman@Josephs-MacBook-Pro nameko % pytest test -x -v --timeout 30 --timeout_method=thread
================================================================================================= test session starts ==================================================================================================
platform darwin -- Python 3.8.5, pytest-6.0.1, py-1.9.0, pluggy-0.13.1 -- /Users/travelling_devsman/Desktop/programming/opensource/nameko/env/bin/python
cachedir: .pytest_cache
rootdir: /Users/travelling_devsman/Desktop/programming/opensource/nameko, configfile: setup.cfg
plugins: nameko-sqlalchemy-1.5.0, timeout-1.4.2, nameko-2.12.0
timeout: 30.0s
timeout method: thread
timeout func_only: False
collected 655 items
test/test_broker.py::test_idle_disconnect PASSED [ 0%]
test/test_broker.py::test_proxy_disconnect_with_active_worker FAILED [ 0%]
======================================================================================================= FAILURES =======================================================================================================
_______________________________________________________________________________________ test_proxy_disconnect_with_active_worker _______________________________________________________________________________________
container_factory = <function container_factory.<locals>.make_container at 0x10da8d160>, rabbit_manager = <nameko.testing.rabbit.Client object at 0x10da490d0>
rabbit_config = {'AMQP_URI': 'pyamqp://guest:guest@localhost:5672/nameko_test_ogrjfmurka', 'username': 'guest', 'vhost': 'nameko_test_ogrjfmurka'}
def test_proxy_disconnect_with_active_worker(
container_factory, rabbit_manager, rabbit_config):
""" Break the connection to rabbit while a service's queue consumer and
rabbit while the service has an in-flight rpc request (i.e. it is waiting
on a reply).
"""
# ExampleService is the target; ProxyService has the rpc_proxy;
proxy_container = container_factory(ProxyService, rabbit_config)
example_container = container_factory(ExampleService, rabbit_config)
proxy_container.start()
# get proxyservice's queue consumer connection while we know it's the
# only active connection
vhost = rabbit_config['vhost']
connections = get_rabbit_connections(vhost, rabbit_manager)
> assert len(connections) == 1
E assert 0 == 1
E +0
E -1
test/test_broker.py:116: AssertionError
------------------------------------------------------------------------------------------------ Captured log teardown -------------------------------------------------------------------------------------------------
WARNING kombu.mixins:mixins.py:180 Connection to broker lost, trying to re-establish connection...
Traceback (most recent call last):
File "/Users/travelling_devsman/Desktop/programming/opensource/nameko/env/lib/python3.8/site-packages/kombu/mixins.py", line 175, in run
for _ in self.consume(limit=None, **kwargs):
File "/Users/travelling_devsman/Desktop/programming/opensource/nameko/env/lib/python3.8/site-packages/kombu/mixins.py", line 197, in consume
conn.drain_events(timeout=safety_interval)
File "/Users/travelling_devsman/Desktop/programming/opensource/nameko/env/lib/python3.8/site-packages/kombu/connection.py", line 324, in drain_events
return self.transport.drain_events(self.connection, **kwargs)
File "/Users/travelling_devsman/Desktop/programming/opensource/nameko/env/lib/python3.8/site-packages/kombu/transport/pyamqp.py", line 103, in drain_events
return connection.drain_events(**kwargs)
File "/Users/travelling_devsman/Desktop/programming/opensource/nameko/env/lib/python3.8/site-packages/amqp/connection.py", line 508, in drain_events
while not self.blocking_read(timeout):
File "/Users/travelling_devsman/Desktop/programming/opensource/nameko/env/lib/python3.8/site-packages/amqp/connection.py", line 514, in blocking_read
return self.on_inbound_frame(frame)
File "/Users/travelling_devsman/Desktop/programming/opensource/nameko/env/lib/python3.8/site-packages/amqp/method_framing.py", line 55, in on_frame
callback(channel, method_sig, buf, None)
File "/Users/travelling_devsman/Desktop/programming/opensource/nameko/env/lib/python3.8/site-packages/amqp/connection.py", line 520, in on_inbound_method
return self.channels[channel_id].dispatch_method(
File "/Users/travelling_devsman/Desktop/programming/opensource/nameko/env/lib/python3.8/site-packages/amqp/abstract_channel.py", line 145, in dispatch_method
listener(*args)
File "/Users/travelling_devsman/Desktop/programming/opensource/nameko/env/lib/python3.8/site-packages/amqp/channel.py", line 1453, in _on_basic_cancel
raise ConsumerCancelled(consumer_tag, spec.Basic.Cancel)
amqp.exceptions.ConsumerCancelled: Basic.cancel: (0) None4
=============================================================================================== short test summary info ================================================================================================
FAILED test/test_broker.py::test_proxy_disconnect_with_active_worker - assert 0 == 1
Am I missing anything?
Edit: I have rabbitmq running locally.