mirror of
https://github.com/littlefs-project/littlefs.git
synced 2025-10-18 09:21:29 +08:00
Removed unnecessarily heavy RAM usage from logs in bench/test.py
For long running processes (testing with >1pls) these logs can grow into multiple gigabytes, humorously we never access more than the last n lines as requested by --context. Piping the stdout with --stdout does not use additional RAM.
This commit is contained in:
@@ -799,7 +799,7 @@ def run_stage(name, runner_, ids, stdout_, trace_, output_, **args):
|
|||||||
mpty = os.fdopen(mpty, 'r', 1)
|
mpty = os.fdopen(mpty, 'r', 1)
|
||||||
|
|
||||||
last_id = None
|
last_id = None
|
||||||
last_stdout = []
|
last_stdout = co.deque(maxlen=args.get('context', 5) + 1)
|
||||||
last_assert = None
|
last_assert = None
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
@@ -826,7 +826,7 @@ def run_stage(name, runner_, ids, stdout_, trace_, output_, **args):
|
|||||||
if op == 'running':
|
if op == 'running':
|
||||||
locals.seen_perms += 1
|
locals.seen_perms += 1
|
||||||
last_id = m.group('id')
|
last_id = m.group('id')
|
||||||
last_stdout = []
|
last_stdout.clear()
|
||||||
last_assert = None
|
last_assert = None
|
||||||
elif op == 'finished':
|
elif op == 'finished':
|
||||||
case = m.group('case')
|
case = m.group('case')
|
||||||
@@ -862,7 +862,7 @@ def run_stage(name, runner_, ids, stdout_, trace_, output_, **args):
|
|||||||
if args.get('keep_going'):
|
if args.get('keep_going'):
|
||||||
proc.kill()
|
proc.kill()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
raise BenchFailure(last_id, 1, last_stdout)
|
raise BenchFailure(last_id, 1, list(last_stdout))
|
||||||
finally:
|
finally:
|
||||||
children.remove(proc)
|
children.remove(proc)
|
||||||
mpty.close()
|
mpty.close()
|
||||||
@@ -872,7 +872,7 @@ def run_stage(name, runner_, ids, stdout_, trace_, output_, **args):
|
|||||||
raise BenchFailure(
|
raise BenchFailure(
|
||||||
last_id,
|
last_id,
|
||||||
proc.returncode,
|
proc.returncode,
|
||||||
last_stdout,
|
list(last_stdout),
|
||||||
last_assert)
|
last_assert)
|
||||||
|
|
||||||
def run_job(runner_, ids=[], start=None, step=None):
|
def run_job(runner_, ids=[], start=None, step=None):
|
||||||
|
@@ -809,7 +809,7 @@ def run_stage(name, runner_, ids, stdout_, trace_, output_, **args):
|
|||||||
mpty = os.fdopen(mpty, 'r', 1)
|
mpty = os.fdopen(mpty, 'r', 1)
|
||||||
|
|
||||||
last_id = None
|
last_id = None
|
||||||
last_stdout = []
|
last_stdout = co.deque(maxlen=args.get('context', 5) + 1)
|
||||||
last_assert = None
|
last_assert = None
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
@@ -836,7 +836,7 @@ def run_stage(name, runner_, ids, stdout_, trace_, output_, **args):
|
|||||||
if op == 'running':
|
if op == 'running':
|
||||||
locals.seen_perms += 1
|
locals.seen_perms += 1
|
||||||
last_id = m.group('id')
|
last_id = m.group('id')
|
||||||
last_stdout = []
|
last_stdout.clear()
|
||||||
last_assert = None
|
last_assert = None
|
||||||
elif op == 'powerloss':
|
elif op == 'powerloss':
|
||||||
last_id = m.group('id')
|
last_id = m.group('id')
|
||||||
@@ -867,7 +867,7 @@ def run_stage(name, runner_, ids, stdout_, trace_, output_, **args):
|
|||||||
if args.get('keep_going'):
|
if args.get('keep_going'):
|
||||||
proc.kill()
|
proc.kill()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
raise TestFailure(last_id, 1, last_stdout)
|
raise TestFailure(last_id, 1, list(last_stdout))
|
||||||
finally:
|
finally:
|
||||||
children.remove(proc)
|
children.remove(proc)
|
||||||
mpty.close()
|
mpty.close()
|
||||||
@@ -877,7 +877,7 @@ def run_stage(name, runner_, ids, stdout_, trace_, output_, **args):
|
|||||||
raise TestFailure(
|
raise TestFailure(
|
||||||
last_id,
|
last_id,
|
||||||
proc.returncode,
|
proc.returncode,
|
||||||
last_stdout,
|
list(last_stdout),
|
||||||
last_assert)
|
last_assert)
|
||||||
|
|
||||||
def run_job(runner_, ids=[], start=None, step=None):
|
def run_job(runner_, ids=[], start=None, step=None):
|
||||||
|
Reference in New Issue
Block a user