summaryrefslogtreecommitdiff
path: root/cpp/src/tests
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2013-11-08 20:18:58 +0000
committerAlan Conway <aconway@apache.org>2013-11-08 20:18:58 +0000
commit5546c162e3821930207a6aaeacd67275022bcceb (patch)
treee5967f24095c70189c4bd652c553a988e5efa4f3 /cpp/src/tests
parentd6c187e8b25ff0e9c9749a9b49462b81025da588 (diff)
downloadqpid-python-5546c162e3821930207a6aaeacd67275022bcceb.tar.gz
QPID-5318: HA tests fail sporadically with "AttributeError: 'NoneType' object has no attribute 'name'"
This was due to a race condition where a session was deleted while the QmfAgent was looking it up. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1540171 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
-rwxr-xr-xcpp/src/tests/ha_test.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cpp/src/tests/ha_test.py b/cpp/src/tests/ha_test.py
index da28ff6712..8dd1347144 100755
--- a/cpp/src/tests/ha_test.py
+++ b/cpp/src/tests/ha_test.py
@@ -54,8 +54,9 @@ class QmfAgent(object):
def repsub_queue(self, sub):
"""If QMF subscription sub is a replicating subscription return
the name of the replicated queue, else return None"""
- session_name = self.getSession(sub.sessionRef).name
- m = re.search("qpid.ha-q:(.*)\.", session_name)
+ session = self.getSession(sub.sessionRef)
+ if not session: return None
+ m = re.search("qpid.ha-q:(.*)\.", session.name)
return m and m.group(1)
def repsub_queues(self):