The notification listener tests have a listener endpoint that will stop
the listener thread when a certain number of messages have been
received. If this doesn't work, the main thread will time out its
join() after 5 seconds and the only way sign of this is that the test
took over 5 seconds.
Let's make stop_listener() return a boolean indicating whether the the
thread has stopped or we timed out, and assert that the thread has
stopped.
Fix a few cases where the thread hasn't stopped. In the 'two exchanges'
case, we send three messages but only two are to the exchanges we are
listening on. In the tests using the HANDLED return value, the info()
handler which stops the thread was never been called because that
endpoint was last in the endpoints list.
Change-Id: Iea2486f23cee073c3891188d7aabb22ae945900d
There is a non-printable character (c2a0) in a comment line, which
in a new Neutron test case causes a StringException. There are
three issues here.
1) Encoding issue in the file.
2) No detection of encoding issues in files.
3) Neutron tests mask the failure detail
This addresses the first issue. Bug 1334798 in Neutron was created
for the last issue. Oslo team is aware of the second issue.
Related-Bug: #1334798
Change-Id: I8cfa6c93085a26666a8b4bee06dcd52709d04a95
The listener of ListenerSetupMixin had an incorrect info implementation
that couldn't be called properly. This patch fixes the method signature.
Change-Id: I33153f04ce23474cfaffaa1db20b8582befa324d
Even in case of libraries and when they are not big like nova.
It is better to use next rules:
1) structure of tests directory is the same as a root of project
Tests directory will be well organized, and it will be simple to find
where to write tests
2) names for end modules should be test_<name_of_testing_module>.py
Change-Id: Ie13d1b709e863f6a9babaaa2bf1e042ef9251671
The fanout queues of the fake driver are created at the first executor
poll, but if we use eventlet executor and the fake driver, when the sender
delivers a fanout message before the first poll, the message goes to the
topic queue instead of the server fanout queue.
The changes fixes that by ensuring the all queues exists when the
listener is created.
Closes bug #1331453
Change-Id: I92e7c01dd87d634b741bbcaea92f48730fdd555e
The eventlet executor need additional code to make the RPC server sample
work. Using the blocking executor makes things easier to setup for a
newcomer.
Change-Id: I56dfa54a178962d4ced34e2f15eaf9312b7087cc
Passing mutable objects as default args is a known Python pitfall.
We'd better avoid this.
Change-Id: I67cc0774a65886ef9fce0b72e52157b622248a85
Closes-Bug: #1327473
There are files containing string format arguments inside
logging messages. Using logging function parameters should
be preferred.
Change-Id: I4a7ce6916aefb2f2d445f0ebd977c824b1c51e24
Partial-Bug: #1321274
This change disables the connection pool in qpid interfaces tests to
ensure that each tests are isolated.
Closes bug: #1331459
Change-Id: Ib4a49be9f605dda5f2cbcbade3851345866e5797
If one has the credentials misconfigured for rabbitmq currently the following
error message is shown: "AMQP server on 10.0.0.23:5672 is unreachable:
Socket closed. Trying again in 1 seconds. " This is confusing because the
problem is the login creditentials are wrong but the server can be reached.
Since the rabbmitmq server allowed the initial connection and closed the
socket it's likely an authenication issue. This patch now logs: "AMQP server
10.0.0.23:5672 closed the connection. Check login credentials: Socket closed"
to hint the user that it could be a credential issue.
Change-Id: Iadff35d88a9cf704c1edd2d5036a113966db3ea3
Closes-bug: 1325750
The notify method of the routing notifier don't have the correct
signature and change the case of the priority.
This change fixes it.
Change-Id: I833b19d0c054c94b861a4f6cc263c3487fa0e544
Closes-bug: #1316681
allowed_remote_exmods which is passed to _multi_send method in
impl_zmq.py is not passed further to _call, _cast, etc.
Due to that, all remote exceptions, that are supposed to be
expected, are wrapped into messaging.RemoteError exception with
all details of the remote exception.
To fix this allowed_remote_exmods needs to be passed as a
parameter in a called method().
Change-Id: If1dc2f85eab6f542bc21961b9d5c0bd0ab64add2
Closes-Bug: 1330460
Having an *args list following the retry kwargs just screams:
SyntaxError: non-keyword arg after keyword arg
but we don't actually pass any args to methods invoked via ensure() so
these are just unused and can be removed. If we did want them in future
we could just use functools.partial().
Change-Id: Idef12bbc94d39c84ee06ddd6d743f3d2f705a8d1
When a rpc client try to make a RPC call and the server is unreachable
The rpc call hang until the server come back.
In most case this is the desired behavior.
But sometimes, we can prefer that the library raise an exception after a
certain number of retries.
For example in ceilometer, when publishing a
storage.objects.incoming.bytes sample from the Swift middleware to an
AMQP topic, you might not want to block the Swift client if the AMQP broker
is unavailable - instead, you might have a queueing policy whereby
if a single reconection attempt fails we queue the sample in memory and
try again when another sample is to be published.
This patch is the oslo.messaging part that allow this.
Closes bug #1282639
Co-Authored-By: Ala Rezmerita <ala.rezmerita@cloudwatt.com>
Change-Id: I32086d0abf141c368343bf225d4b021da496c020
For asynchronous programming, a timeout parameter is required on the listener
to allow to stop it at exit. poll() returns None on timeout.
It plan to use it in my new asyncio (Trollius) executor:
https://review.openstack.org/#/c/70983/
See also the related blueprint for the rationale:
https://wiki.openstack.org/wiki/Oslo/blueprints/asyncio
Change-Id: I918ae3c267743a0eaed1d6a210c79fb4a0eb8733
In order to keep this patch to just a requirements bump, ignore new and
stricter hacking rules that are being triggered. Fixing up the code and
turning these on is out of scope of this patch and is for future patches.
Change-Id: I5711e066da1076486d291bc4f45359ecb26e1b1a