summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-12-03 12:20:04 +0100
committerBenoit Foucher <benoit@zeroc.com>2014-12-03 12:20:04 +0100
commitcfed5bee3ec273d17c116706178d2af2b324fd82 (patch)
treefb7161a4d50bc918d3673a59556a43b447c09fae /py
parentFixed ICE-6014: don't prepend /usr/bin to PATH, it break Java1.8 PATH setting (diff)
downloadice-cfed5bee3ec273d17c116706178d2af2b324fd82.tar.bz2
ice-cfed5bee3ec273d17c116706178d2af2b324fd82.tar.xz
ice-cfed5bee3ec273d17c116706178d2af2b324fd82.zip
Fixes for ICE-6031 and ICE-6049: better timings for timeout test
Diffstat (limited to 'py')
-rw-r--r--py/test/Ice/timeout/AllTests.py39
1 files changed, 19 insertions, 20 deletions
diff --git a/py/test/Ice/timeout/AllTests.py b/py/test/Ice/timeout/AllTests.py
index 351370cc1ad..fac27f575a1 100644
--- a/py/test/Ice/timeout/AllTests.py
+++ b/py/test/Ice/timeout/AllTests.py
@@ -58,9 +58,8 @@ def allTests(communicator):
#
# Expect ConnectTimeoutException.
#
- to = Test.TimeoutPrx.uncheckedCast(obj.ice_timeout(250))
- to.holdAdapter(500)
- to.ice_getConnection().close(True) # Force a reconnect.
+ to = Test.TimeoutPrx.uncheckedCast(obj.ice_timeout(100))
+ timeout.holdAdapter(500)
try:
to.op()
test(False)
@@ -71,8 +70,7 @@ def allTests(communicator):
#
timeout.op() # Ensure adapter is active.
to = Test.TimeoutPrx.uncheckedCast(obj.ice_timeout(1000))
- to.holdAdapter(500)
- to.ice_getConnection().close(True) # Force a reconnect.
+ timeout.holdAdapter(500)
try:
to.op()
except Ice.ConnectTimeoutException:
@@ -91,8 +89,8 @@ def allTests(communicator):
seq = ''.join(seq) # make into a byte array
else:
seq = bytes([0 for x in range(0, 10000000)])
- to = Test.TimeoutPrx.uncheckedCast(obj.ice_timeout(250))
- to.holdAdapter(1000)
+ to = Test.TimeoutPrx.uncheckedCast(obj.ice_timeout(100))
+ timeout.holdAdapter(500)
try:
to.sendData(seq)
test(False)
@@ -103,7 +101,7 @@ def allTests(communicator):
#
timeout.op() # Ensure adapter is active.
to = Test.TimeoutPrx.uncheckedCast(obj.ice_timeout(1000))
- to.holdAdapter(500)
+ timeout.holdAdapter(500)
try:
if sys.version_info[0] == 2:
seq2 = []
@@ -120,7 +118,7 @@ def allTests(communicator):
sys.stdout.write("testing invocation timeout... ")
sys.stdout.flush()
connection = obj.ice_getConnection();
- to = Test.TimeoutPrx.uncheckedCast(obj.ice_invocationTimeout(250));
+ to = Test.TimeoutPrx.uncheckedCast(obj.ice_invocationTimeout(100));
test(connection == to.ice_getConnection());
try:
to.sleep(500);
@@ -155,9 +153,9 @@ def allTests(communicator):
sys.stdout.write("testing close timeout... ")
sys.stdout.flush()
- to = Test.TimeoutPrx.checkedCast(obj.ice_timeout(250));
+ to = Test.TimeoutPrx.checkedCast(obj.ice_timeout(100));
connection = to.ice_getConnection();
- timeout.holdAdapter(750);
+ timeout.holdAdapter(500);
connection.close(False);
try:
connection.getInfo(); # getInfo() doesn't throw in the closing state.
@@ -182,10 +180,10 @@ def allTests(communicator):
#
initData = Ice.InitializationData()
initData.properties = communicator.getProperties().clone()
- initData.properties.setProperty("Ice.Override.Timeout", "250")
+ initData.properties.setProperty("Ice.Override.Timeout", "100")
comm = Ice.initialize(initData)
to = Test.TimeoutPrx.checkedCast(comm.stringToProxy(sref))
- to.holdAdapter(500)
+ timeout.holdAdapter(500)
try:
to.sendData(seq)
test(False)
@@ -196,7 +194,7 @@ def allTests(communicator):
#
timeout.op() # Ensure adapter is active.
to = Test.TimeoutPrx.checkedCast(to.ice_timeout(1000))
- to.holdAdapter(500);
+ timeout.holdAdapter(500);
try:
to.sendData(seq)
test(False)
@@ -208,7 +206,7 @@ def allTests(communicator):
#
initData = Ice.InitializationData()
initData.properties = communicator.getProperties().clone()
- initData.properties.setProperty("Ice.Override.ConnectTimeout", "500")
+ initData.properties.setProperty("Ice.Override.ConnectTimeout", "250")
comm = Ice.initialize(initData)
timeout.holdAdapter(750)
to = Test.TimeoutPrx.uncheckedCast(comm.stringToProxy(sref))
@@ -231,9 +229,10 @@ def allTests(communicator):
#
# Verify that timeout set via ice_timeout() is still used for requests.
#
- to.op() # Force connection.
+ timeout.op() # Ensure adapter is active.
+ to = Test.TimeoutPrx.uncheckedCast(to.ice_timeout(100));
+ to.ice_getConnection(); # Establish connection
timeout.holdAdapter(750);
- to = Test.TimeoutPrx.uncheckedCast(to.ice_timeout(500));
try:
to.sendData(seq)
test(False)
@@ -246,13 +245,13 @@ def allTests(communicator):
#
initData = Ice.InitializationData()
initData.properties = communicator.getProperties().clone()
- initData.properties.setProperty("Ice.Override.CloseTimeout", "200")
+ initData.properties.setProperty("Ice.Override.CloseTimeout", "100")
comm = Ice.initialize(initData)
connection = comm.stringToProxy(sref).ice_getConnection();
- timeout.holdAdapter(750);
+ timeout.holdAdapter(500);
now = time.clock();
comm.destroy();
- test((time.clock() - now) < 0.5);
+ test((time.clock() - now) < 0.4);
print("ok")