summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2019-08-22 16:14:09 +0200
committerBenoit Foucher <benoit@zeroc.com>2019-08-22 16:14:09 +0200
commitb0f6341f4ef05ee6f59b61bb18e7722e3f96347d (patch)
treeb6653af34c38222d0e1f4eed9d6674caadf5a0c0 /python
parentWorkaround for AIX issue with SSL_write and EWOULDBLOCK (diff)
downloadice-b0f6341f4ef05ee6f59b61bb18e7722e3f96347d.tar.bz2
ice-b0f6341f4ef05ee6f59b61bb18e7722e3f96347d.tar.xz
ice-b0f6341f4ef05ee6f59b61bb18e7722e3f96347d.zip
Fixed Ice/timeout test to ensure the client doesn't hang in case of test failure
Diffstat (limited to 'python')
-rw-r--r--python/test/Ice/timeout/AllTests.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/python/test/Ice/timeout/AllTests.py b/python/test/Ice/timeout/AllTests.py
index 2a15d4c0fc0..e676e05dac6 100644
--- a/python/test/Ice/timeout/AllTests.py
+++ b/python/test/Ice/timeout/AllTests.py
@@ -55,6 +55,19 @@ def connect(prx):
return prx.ice_getConnection(); # Establish connection
def allTests(helper, communicator):
+ controller = Test.ControllerPrx.checkedCast(
+ communicator.stringToProxy("controller:{0}".format(helper.getTestEndpoint(num=1))))
+ test(controller != None)
+
+ try:
+ allTestsWithController(helper, communicator, controller)
+ except Exception:
+ # Ensure the adapter is not in the holding state when an unexpected exception occurs to prevent
+ # the test from hanging on exit in case a connection which disables timeouts is still opened.
+ controller.resumeAdapter()
+ raise
+
+def allTestsWithController(helper, communicator, controller):
sref = "timeout:{0}".format(helper.getTestEndpoint())
obj = communicator.stringToProxy(sref)
@@ -63,10 +76,6 @@ def allTests(helper, communicator):
timeout = Test.TimeoutPrx.checkedCast(obj)
test(timeout != None)
- controller = Test.ControllerPrx.checkedCast(
- communicator.stringToProxy("controller:{0}".format(helper.getTestEndpoint(num=1))))
- test(controller != None)
-
sys.stdout.write("testing connect timeout... ")
sys.stdout.flush()
#