Skip to content

Commit a156d34

Browse files
Added fix to allow the relevant CI check to pass.
1 parent 0300413 commit a156d34

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

scripts/tests/run_tv_casting_test.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,14 @@ def test_discovery_fn(tv_app_rel_path, tv_casting_app_rel_path):
190190
with LogFileManager(linux_tv_app_log_path, 'w') as linux_tv_app_log_file:
191191
tv_app_abs_path = os.path.abspath(tv_app_rel_path)
192192

193-
if sys.platform == 'darwin':
194-
# Try to avoid any stdout buffering in our tests.
195-
cmd = ['stdbuf', '-o0', '-i0']
193+
# Configure command options to disable stdout buffering during tests
194+
disable_stdout_buffering_cmd = []
195+
# On Unix-like systems, use stdbuf to disable stdout buffering
196+
if sys.platform == 'darwin' or sys.platform == 'linux':
197+
disable_stdout_buffering_cmd = ['stdbuf', '-o0', '-i0']
196198

197199
# Run the Linux tv-app subprocess.
198-
with ProcessManager(cmd + [tv_app_abs_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE) as tv_app_process:
200+
with ProcessManager(disable_stdout_buffering_cmd + [tv_app_abs_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE) as tv_app_process:
199201
start_wait_time = time.time()
200202

201203
# Loop until either the subprocess starts successfully or timeout occurs.
@@ -224,7 +226,7 @@ def test_discovery_fn(tv_app_rel_path, tv_casting_app_rel_path):
224226
tv_casting_app_abs_path = os.path.abspath(tv_casting_app_rel_path)
225227

226228
# Run the Linux tv-casting-app subprocess.
227-
with ProcessManager(cmd + [tv_casting_app_abs_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE) as tv_casting_app_process:
229+
with ProcessManager(disable_stdout_buffering_cmd + [tv_casting_app_abs_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE) as tv_casting_app_process:
228230
# Initialize variables.
229231
continue_parsing = False
230232
valid_discovered_commissioner = ''

0 commit comments

Comments
 (0)