From 50a39102289bedb60cec1f97ad3583733a08646c Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 8 Nov 2013 20:18:58 +0000 Subject: 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@1540171 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/tests/ha_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'qpid/cpp/src') diff --git a/qpid/cpp/src/tests/ha_test.py b/qpid/cpp/src/tests/ha_test.py index da28ff6712..8dd1347144 100755 --- a/qpid/cpp/src/tests/ha_test.py +++ b/qpid/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): -- cgit v1.2.1