@@ -190,12 +190,14 @@ def test_discovery_fn(tv_app_rel_path, tv_casting_app_rel_path):
190
190
with LogFileManager (linux_tv_app_log_path , 'w' ) as linux_tv_app_log_file :
191
191
tv_app_abs_path = os .path .abspath (tv_app_rel_path )
192
192
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' ]
196
198
197
199
# 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 :
199
201
start_wait_time = time .time ()
200
202
201
203
# 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):
224
226
tv_casting_app_abs_path = os .path .abspath (tv_casting_app_rel_path )
225
227
226
228
# 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 :
228
230
# Initialize variables.
229
231
continue_parsing = False
230
232
valid_discovered_commissioner = ''
0 commit comments