mirror of
https://github.com/wassname/ray.git
synced 2026-07-15 11:25:40 +08:00
Print the driver stdout/stderr if we fail to decode it in jenkins. (#567)
* Print the driver stdout/stderr if we fail to decode it in jenkins. * Fix whitespace. * Add explanation.
This commit is contained in:
committed by
Philipp Moritz
parent
849d2aaf47
commit
07b21e057c
@@ -20,10 +20,25 @@ def wait_for_output(proc):
|
||||
A tuple of the stdout and stderr of the process as strings.
|
||||
"""
|
||||
stdout_data, stderr_data = proc.communicate()
|
||||
stdout_data = (stdout_data.decode("ascii") if stdout_data is not None
|
||||
else None)
|
||||
stderr_data = (stderr_data.decode("ascii") if stderr_data is not None
|
||||
else None)
|
||||
|
||||
if stdout_data is not None:
|
||||
try:
|
||||
# NOTE(rkn): This try/except block is here because I once saw an
|
||||
# exception raised here and want to print more information if that
|
||||
# happens again.
|
||||
stdout_data = stdout_data.decode("ascii")
|
||||
except UnicodeDecodeError:
|
||||
raise Exception("Failed to decode stdout_data:", stdout_data)
|
||||
|
||||
if stderr_data is not None:
|
||||
try:
|
||||
# NOTE(rkn): This try/except block is here because I once saw an
|
||||
# exception raised here and want to print more information if that
|
||||
# happens again.
|
||||
stderr_data = stderr_data.decode("ascii")
|
||||
except UnicodeDecodeError:
|
||||
raise Exception("Failed to decode stderr_data:", stderr_data)
|
||||
|
||||
return stdout_data, stderr_data
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user