summaryrefslogtreecommitdiff
path: root/python/test/Ice/timeout/Server.py
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2017-09-15 12:18:41 +0200
committerBenoit Foucher <benoit@zeroc.com>2017-09-15 12:18:41 +0200
commita4fb9c391caabef6de9cfbd126f4fe10755ece49 (patch)
tree36dfe5b0a110dddd09f49882649d8c2de825f4b4 /python/test/Ice/timeout/Server.py
parentRemoved Eclipse .launch files (diff)
downloadice-a4fb9c391caabef6de9cfbd126f4fe10755ece49.tar.bz2
ice-a4fb9c391caabef6de9cfbd126f4fe10755ece49.tar.xz
ice-a4fb9c391caabef6de9cfbd126f4fe10755ece49.zip
Fixed timeout tests to be less time sensitive
The tests now use a controller to hold/activate the adapter instead of relying on a timer. Fixes ICE-8312.
Diffstat (limited to 'python/test/Ice/timeout/Server.py')
-rwxr-xr-xpython/test/Ice/timeout/Server.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/python/test/Ice/timeout/Server.py b/python/test/Ice/timeout/Server.py
index 917f8e90017..33bc4e780ac 100755
--- a/python/test/Ice/timeout/Server.py
+++ b/python/test/Ice/timeout/Server.py
@@ -40,19 +40,36 @@ class TimeoutI(Test.Timeout):
if timeout != 0:
time.sleep(timeout / 1000.0)
+class ControllerI(Test.Controller):
+
+ def __init__(self, adapter):
+ self.adapter = adapter
+
def holdAdapter(self, to, current=None):
- current.adapter.hold()
- t = ActivateAdapterThread(current.adapter, to)
- t.start()
+ self.adapter.hold()
+ if to >= 0:
+ t = ActivateAdapterThread(self.adapter, to)
+ t.start()
+
+ def resumeAdapter(self, current=None):
+ self.adapter.activate()
def shutdown(self, current=None):
current.adapter.getCommunicator().shutdown()
def run(args, communicator):
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010")
+ communicator.getProperties().setProperty("ControllerAdapter.Endpoints", "default -p 12011");
+ communicator.getProperties().setProperty("ControllerAdapter.ThreadPool.Size", "1");
+
adapter = communicator.createObjectAdapter("TestAdapter")
adapter.add(TimeoutI(), Ice.stringToIdentity("timeout"))
adapter.activate()
+
+ controllerAdapter = communicator.createObjectAdapter("ControllerAdapter")
+ controllerAdapter.add(ControllerI(adapter), Ice.stringToIdentity("controller"))
+ controllerAdapter.activate()
+
communicator.waitForShutdown()
return True