THRIFT-3694 [Windows] Disable tests of a few servers that are not supported
This closes #909
diff --git a/test/py/RunClientServer.py b/test/py/RunClientServer.py
index 15c4d2b..c1443ec 100755
--- a/test/py/RunClientServer.py
+++ b/test/py/RunClientServer.py
@@ -21,6 +21,7 @@
from __future__ import division
from __future__ import print_function
+import platform
import copy
import os
import signal
@@ -56,15 +57,19 @@
'json',
]
-SERVERS = [
- "TSimpleServer",
- "TThreadedServer",
- "TThreadPoolServer",
- "TProcessPoolServer",
- "TForkingServer",
- "TNonblockingServer",
- "THttpServer",
-]
+
+def default_servers():
+ servers = [
+ 'TSimpleServer',
+ 'TThreadedServer',
+ 'TThreadPoolServer',
+ 'TNonblockingServer',
+ 'THttpServer',
+ ]
+ if platform.system() != 'Windows':
+ servers.append('TProcessPoolServer')
+ servers.append('TForkingServer')
+ return servers
def relfile(fname):
@@ -77,7 +82,7 @@
pypath = env.get('PYTHONPATH', None)
if pypath:
dirs.append(pypath)
- env['PYTHONPATH'] = ':'.join(dirs)
+ env['PYTHONPATH'] = os.pathsep.join(dirs)
if gendir.endswith('gen-py-no_utf8strings'):
env['THRIFT_TEST_PY_NO_UTF8STRINGS'] = '1'
return env
@@ -135,7 +140,6 @@
# Wait for the server to start accepting connections on the given port.
sleep_time = 0.1 # Seconds
max_attempts = 100
- # try:
attempt = 0
while True:
sock4 = socket.socket()
@@ -172,7 +176,8 @@
'processes to terminate via alarm'
% (server_class, proto, use_zlib, use_ssl, extra_sleep))
time.sleep(extra_sleep)
- os.kill(serverproc.pid, signal.SIGKILL)
+ sig = signal.SIGKILL if platform.system() != 'Windows' else signal.SIGABRT
+ os.kill(serverproc.pid, sig)
serverproc.wait()
@@ -274,9 +279,9 @@
generated_dirs.append('gen-py-%s' % (gp_dir))
# commandline permits a single class name to be specified to override SERVERS=[...]
- servers = SERVERS
+ servers = default_servers()
if len(args) == 1:
- if args[0] in SERVERS:
+ if args[0] in servers:
servers = args
else:
print('Unavailable server type "%s", please choose one of: %s' % (args[0], servers))