diff --git a/tests/integrationv2/processes.py b/tests/integrationv2/processes.py index 8c8b4b9c697..4b774c3b340 100644 --- a/tests/integrationv2/processes.py +++ b/tests/integrationv2/processes.py @@ -168,7 +168,7 @@ def _communicate(self, input_data=None, send_marker_list=None, close_marker=None self._check_timeout(endtime, orig_timeout, stdout, stderr) # (Key, events) tuple represents a single I/O operation - for key, events in ready: + for key, num_events in ready: # STDIN is only registered to receive events after the send_marker is found. if key.fileobj is self.proc.stdin: print(f'{self.name}: stdin available') @@ -190,7 +190,9 @@ def _communicate(self, input_data=None, send_marker_list=None, close_marker=None send_marker = send_marker_list.pop(0) print(f'{self.name}: next send_marker is {send_marker}') elif key.fileobj in (self.proc.stdout, self.proc.stderr): - print(f'{self.name}: stdout available') + fd_name = self.get_fd_name(self.proc, key.fileobj) + print(f'{self.name}: {fd_name} available') + # 32 KB (32 × 1024 = 32,768 bytes), read 32KB from the file descriptor data = os.read(key.fd, 32768) if not data: @@ -198,6 +200,7 @@ def _communicate(self, input_data=None, send_marker_list=None, close_marker=None print(f"{self.name}: Unregistering: {fd_name} No Data") data_str = str(data) + print(f"raw data read from {self.name}: {data_str}") # Prepends n - 1 bytes of previously-seen stdout to the chunk we'll be searching # through, where n is the size of the send_marker we're currently looking for. @@ -255,8 +258,7 @@ def _communicate(self, input_data=None, send_marker_list=None, close_marker=None selector.unregister(self.proc.stderr) self.proc.kill() - # We check for the close marker in every iteration to ensure that we properly close stdin as soon as the expected - # marker appears in the output. This prevents unnecessary waiting and avoids potential errors. + # During every iteration check to see if we have found a close marker to see if we should close stdin if self.proc.stdin and input_data_sent and not input_data: print(f'{self.name}: finished sending') if close_marker: