kill tests that are hung

This commit is contained in:
Arvid Norberg
2013-06-17 06:54:00 +00:00
parent 7a60f66df5
commit 0bcd97c51e
3 changed files with 13 additions and 9 deletions

View File

@@ -1,11 +1,11 @@
test_dirs: test_dirs:
- test - test
project: project: libtorrent
libtorrent
branch: branch: trunk
trunk
time_limit: 500
features: features:
- variant=release asserts=production - variant=release asserts=production

View File

@@ -51,7 +51,7 @@ options:
def loop(): def loop():
if len(sys.argv) < 3: if len(sys.argv) < 2:
print_usage() print_usage()
sys.exit(1) sys.exit(1)

View File

@@ -78,7 +78,7 @@ def svn_info():
return (revision, author) return (revision, author)
def run_tests(toolset, tests, features, options, test_dir): def run_tests(toolset, tests, features, options, test_dir, time_limit):
xml_file = 'bjam_build.%d.xml' % random.randint(0, 100000) xml_file = 'bjam_build.%d.xml' % random.randint(0, 100000)
results = {} results = {}
@@ -87,7 +87,7 @@ def run_tests(toolset, tests, features, options, test_dir):
os.chdir(test_dir) os.chdir(test_dir)
for t in tests: for t in tests:
p = subprocess.Popen(['bjam', '--out-xml=%s' % xml_file, toolset, t] + options + features.split(' '), stdout=subprocess.PIPE) p = subprocess.Popen(['bjam', '--out-xml=%s' % xml_file, '-l%d' % time_limit, '-q', toolset, t] + options + features.split(' '), stdout=subprocess.PIPE)
output = '' output = ''
for l in p.stdout: for l in p.stdout:
output += l output += l
@@ -182,6 +182,7 @@ def main(argv):
test_dirs = [] test_dirs = []
configs = [] configs = []
options = ['boost=source'] options = ['boost=source']
time_limit = 1200
if 'test_dirs' in cfg: if 'test_dirs' in cfg:
for d in cfg['test_dirs']: for d in cfg['test_dirs']:
test_dirs.append(d) test_dirs.append(d)
@@ -200,6 +201,9 @@ def main(argv):
if 'branch' in cfg: if 'branch' in cfg:
branch_name = cfg['branch'] branch_name = cfg['branch']
if 'time_limit' in cfg:
time_limit = int(cfg['time_limit'])
architecture = platform.machine() architecture = platform.machine()
build_platform = platform.system() + '-' + platform.release() build_platform = platform.system() + '-' + platform.release()
@@ -246,14 +250,14 @@ def main(argv):
futures = [] futures = []
for features in configs: for features in configs:
futures.append(tester_pool.apply_async(run_tests, [toolset, tests, features, options, test_dir])) futures.append(tester_pool.apply_async(run_tests, [toolset, tests, features, options, test_dir, time_limit]))
for future in futures: for future in futures:
(toolset, r) = future.get() (toolset, r) = future.get()
results.update(r) results.update(r)
# for features in configs: # for features in configs:
# (toolset, r) = run_tests(toolset, tests, features, options, test_dir) # (toolset, r) = run_tests(toolset, tests, features, options, test_dir, time_limit)
# results.update(r) # results.update(r)
# each file contains a full set of tests for one speific toolset and platform # each file contains a full set of tests for one speific toolset and platform