diff options
author | Mark Spruiell <mes@zeroc.com> | 2017-03-15 11:18:37 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2017-03-15 11:18:37 -0700 |
commit | df356cdfbf87e36fc49060522364b4c2dff23dd3 (patch) | |
tree | 18434efe819d302c8361d58e80e789b8679625d4 /python/test | |
parent | Fixed warning (diff) | |
download | ice-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.py | 15 |
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" |