@@ -116,6 +116,14 @@ def _communicate(
116116 send_with_newline = False ,
117117 timeout = None ,
118118 ):
119+ print (
120+ f"{ self .name } : Handling process IO: \n "
121+ f" wait_for_marker: { self .wait_for_marker } \n "
122+ f" send_markers: { send_marker_list } \n "
123+ f" close_marker: { close_marker } \n "
124+ f" kill_marker: { kill_marker } "
125+ )
126+
119127 """
120128 This method will read and write data to a subprocess in a non-blocking manner.
121129 The code is heavily based on Popen.communicate. There are a couple differences:
@@ -304,7 +312,7 @@ def _communicate(
304312 if close_marker is None or (
305313 close_marker and close_marker in data_str
306314 ):
307- print (f"{ self .name } Found close marker: closing stdin" )
315+ print (f"{ self .name } : Found close marker: closing stdin" )
308316 input_data_sent = None
309317 self .proc .stdin .close ()
310318
@@ -358,6 +366,7 @@ def __init__(
358366 self ,
359367 cmd_line ,
360368 provider_set_ready_condition ,
369+ name ,
361370 wait_for_marker = None ,
362371 send_marker_list = None ,
363372 close_marker = None ,
@@ -380,6 +389,8 @@ def __init__(
380389 # Command line to execute in the subprocess
381390 self .cmd_line = list (map (str , cmd_line ))
382391
392+ self .name = name
393+
383394 # Total time to wait until killing the subprocess
384395 self .timeout = timeout
385396
@@ -426,7 +437,7 @@ def run(self):
426437 self .results = Results (None , None , None , ex , self .expect_stderr )
427438 raise ex
428439
429- communicator = _processCommunicator (proc , self .cmd_line [ 0 ] )
440+ communicator = _processCommunicator (proc , self .name )
430441
431442 if self .ready_to_test is not None :
432443 # Some processes won't be ready until they have emitted some string in stdout.
@@ -454,10 +465,12 @@ def run(self):
454465 expect_nonzero_exit = self .kill_marker is not None ,
455466 )
456467 except subprocess .TimeoutExpired as ex :
468+ print (f"{ communicator .name } : TIMEOUT. Killing process." )
457469 proc .kill ()
458470 wrapped_ex = TimeoutException (ex )
459471
460472 # Read any remaining output
473+ print (f"{ communicator .name } : TIMEOUT. Reading remaining output." )
461474 proc_results = communicator .communicate ()
462475 self .results = Results (
463476 proc_results [0 ],
0 commit comments