summaryrefslogtreecommitdiff
path: root/python/test
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2017-03-15 11:18:37 -0700
committerMark Spruiell <mes@zeroc.com>2017-03-15 11:18:37 -0700
commitdf356cdfbf87e36fc49060522364b4c2dff23dd3 (patch)
tree18434efe819d302c8361d58e80e789b8679625d4 /python/test
parentFixed warning (diff)
downloadice-df356cdfbf87e36fc49060522364b4c2dff23dd3.tar.bz2
ice-df356cdfbf87e36fc49060522364b4c2dff23dd3.tar.xz
ice-df356cdfbf87e36fc49060522364b4c2dff23dd3.zip
ICE-7669 - Python dispatcher test failure
Diffstat (limited to 'python/test')
-rw-r--r--python/test/Ice/dispatcher/AllTests.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/python/test/Ice/dispatcher/AllTests.py b/python/test/Ice/dispatcher/AllTests.py
index 73c8df9dd4d..b6967a9d5f9 100644
--- a/python/test/Ice/dispatcher/AllTests.py
+++ b/python/test/Ice/dispatcher/AllTests.py
@@ -17,6 +17,7 @@ class Callback:
def __init__(self):
self._called = False
self._cond = threading.Condition()
+ self._mainThread = threading.current_thread()
def check(self):
with self._cond:
@@ -31,24 +32,30 @@ class Callback:
def response(self, f):
test(f.exception() is None)
- test(Dispatcher.Dispatcher.isDispatcherThread())
+ self.checkThread()
self.called()
def exception(self, f):
test(isinstance(f.exception(), Ice.NoEndpointException))
- test(Dispatcher.Dispatcher.isDispatcherThread())
+ self.checkThread()
self.called()
def exceptionEx(self, f):
test(isinstance(f.exception(), Ice.InvocationTimeoutException))
- test(Dispatcher.Dispatcher.isDispatcherThread())
+ self.checkThread()
self.called()
def payload(self, f):
if f.exception():
test(isinstance(f.exception(), Ice.CommunicatorDestroyedException))
else:
- test(Dispatcher.Dispatcher.isDispatcherThread())
+ self.checkThread()
+
+ def checkThread(self):
+ #
+ # A done callback can be invoked recursively from the calling thread if the request was already complete.
+ #
+ test(Dispatcher.Dispatcher.isDispatcherThread() or threading.current_thread() == self._mainThread)
def allTests(communicator, collocated):
sref = "test:default -p 12010"