diff options
| author | Alan Conway <aconway@apache.org> | 2011-04-18 20:40:53 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2011-04-18 20:40:53 +0000 |
| commit | bcf547057b604b30239c1afa122fad175b70be5b (patch) | |
| tree | 1fe781be693d970c3b0efa2b21c37882345b4710 /cpp/src/tests/brokertest.py | |
| parent | 0960e28486aaf55c6fd960bf9ea165d99ebeb11c (diff) | |
| download | qpid-python-bcf547057b604b30239c1afa122fad175b70be5b.tar.gz | |
QPID-3208: Exchanges make best effort to route messages if there is an error.
Previously if multiple queues were bound to the same routing key,
then a failure to deliver to one of the queues (e.g. policy limit
error) could prevent delivery on some of the other queues.
With this commit the exchange delivers to every queue that did not
have an error before raising an error.
Note: this was originally committed as r1092765, but it caused test
failures was reverted as r1092804. The original commit did not create
exceptions of the correct type.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1094734 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/brokertest.py')
| -rw-r--r-- | cpp/src/tests/brokertest.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/cpp/src/tests/brokertest.py b/cpp/src/tests/brokertest.py index 4abe4c2cbe..a19dd305e5 100644 --- a/cpp/src/tests/brokertest.py +++ b/cpp/src/tests/brokertest.py @@ -484,18 +484,24 @@ class BrokerTest(TestCase): cluster = Cluster(self, count, args, expect=expect, wait=wait) return cluster - def assert_browse(self, session, queue, expect_contents, timeout=0): + def browse(self, session, queue, timeout=0): """Assert that the contents of messages on queue (as retrieved using session and timeout) exactly match the strings in expect_contents""" - r = session.receiver("%s;{mode:browse}"%(queue)) - actual_contents = [] try: - for c in expect_contents: actual_contents.append(r.fetch(timeout=timeout).content) - while True: actual_contents.append(r.fetch(timeout=0).content) # Check for extra messages. - except messaging.Empty: pass - r.close() + contents = [] + try: + while True: contents.append(r.fetch(timeout=timeout).content) + except messaging.Empty: pass + finally: pass #FIXME aconway 2011-04-14: r.close() + return contents + + def assert_browse(self, session, queue, expect_contents, timeout=0): + """Assert that the contents of messages on queue (as retrieved + using session and timeout) exactly match the strings in + expect_contents""" + actual_contents = self.browse(session, queue, timeout) self.assertEqual(expect_contents, actual_contents) def join(thread, timeout=10): |
