summaryrefslogtreecommitdiff
path: root/cpp/config/TestUtil.py
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2006-08-15 18:11:38 +0000
committerMarc Laukien <marc@zeroc.com>2006-08-15 18:11:38 +0000
commitd3f3dff08b1302845a3d4ab08fd7e7fb7ecaaa13 (patch)
treedf7c79f1e34a583e555d3c8a5e9efae10374d1ed /cpp/config/TestUtil.py
parentfixing ref-count bug for Communicator wrapper (diff)
downloadice-d3f3dff08b1302845a3d4ab08fd7e7fb7ecaaa13.tar.bz2
ice-d3f3dff08b1302845a3d4ab08fd7e7fb7ecaaa13.tar.xz
ice-d3f3dff08b1302845a3d4ab08fd7e7fb7ecaaa13.zip
started the 'two threads per connection'
Diffstat (limited to 'cpp/config/TestUtil.py')
-rw-r--r--cpp/config/TestUtil.py29
1 files changed, 15 insertions, 14 deletions
diff --git a/cpp/config/TestUtil.py b/cpp/config/TestUtil.py
index b9cb702e717..5cc36d8efd8 100644
--- a/cpp/config/TestUtil.py
+++ b/cpp/config/TestUtil.py
@@ -24,12 +24,13 @@ compress = 0
#compress = 1
#
-# Set threadPerConnection to 1 in case you want to run the tests in
-# thread per connection mode.
+# Set threadPerConnection to 1 or 2 in case you want to run the tests in
+# one or two thread per connection mode.
#
-threadPerConnection = 0
+#threadPerConnection = 0
#threadPerConnection = 1
+threadPerConnection = 2
#
# If you don't set "host" below, then the Ice library will try to find
@@ -52,10 +53,10 @@ import sys, os, re, errno, getopt
from threading import Thread
def usage():
- print "usage: " + sys.argv[0] + " --debug --protocol protocol --compress --host host --threadPerConnection"
+ print "usage: " + sys.argv[0] + " --debug --protocol protocol --compress --host host --threadPerConnection num"
sys.exit(2)
try:
- opts, args = getopt.getopt(sys.argv[1:], "", ["debug", "protocol=", "compress", "host=", "threadPerConnection"])
+ opts, args = getopt.getopt(sys.argv[1:], "", ["debug", "protocol=", "compress", "host=", "threadPerConnection="])
except getopt.GetoptError:
usage()
@@ -67,7 +68,7 @@ for o, a in opts:
if o == "--compress":
compress = 1
if o == "--threadPerConnection":
- threadPerConnection = 1
+ threadPerConnection = a
if o == "--host":
host = a
@@ -386,11 +387,6 @@ if compress:
serverProtocol += " --Ice.Override.Compress"
clientServerProtocol += " --Ice.Override.Compress"
-if threadPerConnection:
- clientProtocol += " --Ice.ThreadPerConnection"
- serverProtocol += " --Ice.ThreadPerConnection"
- clientServerProtocol += " --Ice.ThreadPerConnection"
-
if host != "":
defaultHost = " --Ice.Default.Host=" + host
else:
@@ -399,9 +395,14 @@ else:
commonClientOptions = " --Ice.NullHandleAbort --Ice.Warn.Connections"
commonServerOptions = " --Ice.PrintProcessId --Ice.PrintAdapterReady --Ice.NullHandleAbort" + \
- " --Ice.Warn.Connections --Ice.ServerIdleTime=30" + \
- " --Ice.ThreadPool.Server.Size=1 --Ice.ThreadPool.Server.SizeMax=3" + \
- " --Ice.ThreadPool.Server.SizeWarn=0"
+ " --Ice.Warn.Connections --Ice.ServerIdleTime=30";
+
+if threadPerConnection > 0:
+ commonClientOptions += " --Ice.ThreadPerConnection=" + str(threadPerConnection)
+ commonServerOptions += " --Ice.ThreadPerConnection=" + str(threadPerConnection)
+else:
+ commonServerOptions += " --Ice.ThreadPool.Server.Size=1 --Ice.ThreadPool.Server.SizeMax=3" + \
+ " --Ice.ThreadPool.Server.SizeWarn=0"
clientOptions = clientProtocol + defaultHost + commonClientOptions
serverOptions = serverProtocol + defaultHost + commonServerOptions