Files
scylladb/tests/memcached/test.py
Shlomi Livne b7a83903b5 tests: terminate memcached instance with SIGTERM
Terminate a running memcached instance with a SIGTERM instead of a
SIGKILL to allow the process to close in a cleaner manner

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-01-04 17:17:40 +02:00

31 lines
939 B
Python
Executable File

#!/usr/bin/env python3
import time
import sys
import os
import argparse
import subprocess
def run(args, cmd):
mc = subprocess.Popen([os.path.join('build', args.mode, 'apps', 'memcached', 'memcached')])
print('Memcached started.')
try:
cmdline = ['tests/memcached/test_memcached.py'] + cmd
if args.fast:
cmdline.append('--fast')
print('Running: ' + ' '.join(cmdline))
subprocess.check_call(cmdline)
finally:
print('Killing memcached...')
mc.terminate();
mc.wait()
print('Memcached killed.')
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Seastar test runner")
parser.add_argument('--fast', action="store_true", help="Run only fast tests")
parser.add_argument('--mode', action="store", help="Test app in given mode", default='release')
args = parser.parse_args()
run(args, [])
run(args, ['-U'])