d1dac1c11d

The FakeExchangeManager uses an instance-level storage for FakeExchanges mapping[1]. When a client--server pair is created, each keeps their own instance of FakeDriver -> FakeExchangeManager -> FakeExchange, each of which has their own (instance-level) copy of e.g _server_queues[2], making it impossible for them to communicate. This patch makes the _exchanges mapping a class-level attribute in order to keep the registered exchanges shared between all Manager instances, allowing client and server communication (within a single process). The test_server unit-tests had to be refactored to explicitly pass an exchange name when building a target. This is required for an exchange name change to have any effect during a test case run time when compared to passing the exchange name through the URL. This issue was revealed with this patch. [1] https://github.com/openstack/oslo.messaging/blob/master/oslo_messaging/_drivers/impl_fake.py#L145,#L148 [2] https://github.com/openstack/oslo.messaging/blob/master/oslo_messaging/_drivers/impl_fake.py#L88,#L92 Change-Id: I8dff66f4cafeb1f4c57dbfbfaba5d49e50f55fee Closes-Bug: #1714055
Team and repository tags
Oslo Messaging Library
The Oslo messaging API supports RPC and notifications over a number of different messaging transports.
- License: Apache License, Version 2.0
- Documentation: https://docs.openstack.org/oslo.messaging/latest/
- Source: https://git.openstack.org/cgit/openstack/oslo.messaging
- Bugs: https://bugs.launchpad.net/oslo.messaging
Description
Languages
Python
99.8%
Shell
0.2%