summaryrefslogtreecommitdiff
path: root/regtest/backends
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2013-12-06 17:28:13 +0100
committerCarlos Garcia Campos <carlosgc@gnome.org>2013-12-06 17:28:13 +0100
commit3335d5e52fd7527bba7368ad6e87f1188808582f (patch)
tree6ab7b1532d3927a110146550a9ac8808e8e108e9 /regtest/backends
parent24107ac47625438837d7c29053bff795f986a6bb (diff)
regtest: Limit the stderr files to ~1MB
Some tests send a lot of information to stderr, usually due to parsing errors in buggy documents. More than 1MB of stderr output is diffcult to hanlde and in most cases it's redundant with a lot of duplicated messages. This patch reduced the size of the refs dir for the complete test suite by 1GB.
Diffstat (limited to 'regtest/backends')
-rw-r--r--regtest/backends/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/regtest/backends/__init__.py b/regtest/backends/__init__.py
index 7d0ab8d7..36391d10 100644
--- a/regtest/backends/__init__.py
+++ b/regtest/backends/__init__.py
@@ -206,7 +206,9 @@ class Backend:
def __redirect_stderr_to_file(self, fd, out_path):
stderr_file = None
+ max_size = 1024 * 1024
read_set = [fd]
+
while read_set:
try:
rlist, wlist, xlist = select.select(read_set, [], [])
@@ -225,7 +227,9 @@ class Backend:
if chunk:
if stderr_file is None:
stderr_file = open(out_path + '.stderr', 'wb')
- stderr_file.write(chunk)
+ if max_size > 0:
+ stderr_file.write(chunk)
+ max_size -= len(chunk)
else:
read_set.remove(fd)