Skip to content

Commit

Permalink
twister: Remove newline suffix in BinaryHandler
Browse files Browse the repository at this point in the history
Simics converts newline characters when writing console output to
stdout, so we need to remove them as a suffix string. Otherwise the
console harness fails to match expected PASS/FAIL/RunID string patterns
and twister tests timeout.

Signed-off-by: Maureen Helm <[email protected]>
  • Loading branch information
MaureenHelm authored and nashif committed May 24, 2023
1 parent b87534a commit 6a6d05b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/pylib/twister/twisterlib/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def _output_handler(self, proc, harness):
reader_t.join(this_timeout)
if not reader_t.is_alive() and self.line != b"":
line_decoded = self.line.decode('utf-8', "replace")
stripped_line = line_decoded.rstrip()
stripped_line = line_decoded.rstrip().removesuffix('\\r\\n')
logger.debug("OUTPUT: %s", stripped_line)
log_out_fp.write(line_decoded)
log_out_fp.flush()
Expand Down

0 comments on commit 6a6d05b

Please sign in to comment.