Wrap stdout and stderr decode calls in try-except to catch UnicodeDecodeError when test output contains invalid UTF-8 byte sequences, appending a failure message instead of crashing the test runner.
Wrap stdout and stderr decode calls in try-except to catch UnicodeDecodeError when test output contains invalid UTF-8 byte sequences, appending a failure message instead of crashing the test runner.