Commit e4f2f8a9 authored by Denis Bilenko's avatar Denis Bilenko

testrunner: limit the output stored in the db to 100kb

parent 18c93893
......@@ -35,9 +35,12 @@ one will be selected if not provided.
# Known issues:
# - screws up warnings location, causing them to appear as originated from testrunner.py
# the number of seconds each test script is allowed to run
DEFAULT_TIMEOUT = 20
# the number of bytes of output that is recorded; the rest is thrown away
OUTPUT_LIMIT = 100*1024
import sys
import os
import glob
......@@ -281,6 +284,8 @@ def spawn_subprocesses(options, args):
row_id = store_record(options.db, 'test', params)
params['id'] = row_id
retcode, output = run_subprocess(arg, options)
if len(output) > OUTPUT_LIMIT:
output = output[:OUTPUT_LIMIT] + '<AbridgedOutputWarning>'
if retcode:
sys.stdout.write(output)
print '%s failed with code %s' % (arg, retcode)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment