From 59dcbe79c3161ebea5676dae4c56bd7f35df09d3 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 29 Aug 2022 13:22:51 -0400 Subject: [PATCH] Use stdbuf to try to disable stdout buffering on darwin --- scripts/tests/chiptest/runner.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/tests/chiptest/runner.py b/scripts/tests/chiptest/runner.py index 3cea9b2c3fe9e0..71cf0c7d5e433f 100644 --- a/scripts/tests/chiptest/runner.py +++ b/scripts/tests/chiptest/runner.py @@ -18,6 +18,7 @@ import queue import re import subprocess +import sys import threading import typing @@ -130,6 +131,10 @@ def RunSubprocess(self, cmd, name, wait=True, dependencies=[], timeout_seconds: logging.INFO, capture_delegate=self.capture_delegate, name=name + ' ERR') + if sys.platform == 'darwin': + # Try harder to avoid any stdout buffering in our tests + cmd = ['stdbuf', '-o0'] + cmd + if self.capture_delegate: self.capture_delegate.Log(name, 'EXECUTING %r' % cmd)