Skip to content

Commit 1a35507

Browse files
committed
contest: kunit: remove PYTHONUNBUFFERED when running kunit
Looks like kunit has output buffering problems. Try to unset PYTHONUNBUFFERED for it. We set it in the process to make sure we get logs without delays. Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 82ce040 commit 1a35507

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

contest/remote/kunit.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,13 @@ def test(binfo, rinfo, config):
148148
if load_tgt:
149149
wait_loadavg(load_tgt)
150150

151+
penv = os.environ.copy()
152+
if 'PYTHONUNBUFFERED' in penv:
153+
del penv['PYTHONUNBUFFERED']
154+
151155
process = subprocess.Popen(['./tools/testing/kunit/kunit.py', 'run', '--alltests', '--json', '--arch=x86_64'],
152156
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
153-
cwd=tree_path)
157+
cwd=tree_path, env=penv)
154158
stdout, stderr = process.communicate()
155159
stdout = stdout.decode("utf-8", "ignore")
156160
stderr = stderr.decode("utf-8", "ignore")

0 commit comments

Comments
 (0)