"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "0d0a0785fda7ce4808e81f6b3c27c29a51a0b075"
Unverified Commit c83cec44 authored by Stas Bekman's avatar Stas Bekman Committed by GitHub
Browse files

improve error checking (#8157)

parent 69117628
...@@ -849,7 +849,7 @@ async def _stream_subprocess(cmd, env=None, stdin=None, timeout=None, quiet=Fals ...@@ -849,7 +849,7 @@ async def _stream_subprocess(cmd, env=None, stdin=None, timeout=None, quiet=Fals
# XXX: the timeout doesn't seem to make any difference here # XXX: the timeout doesn't seem to make any difference here
await asyncio.wait( await asyncio.wait(
[ [
_read_stream(p.stdout, lambda l: tee(l, out, sys.stdout)), _read_stream(p.stdout, lambda l: tee(l, out, sys.stdout, label="stdout:")),
_read_stream(p.stderr, lambda l: tee(l, err, sys.stderr, label="stderr:")), _read_stream(p.stderr, lambda l: tee(l, err, sys.stderr, label="stderr:")),
], ],
timeout=timeout, timeout=timeout,
...@@ -869,7 +869,10 @@ def execute_subprocess_async(cmd, env=None, stdin=None, timeout=180, quiet=False ...@@ -869,7 +869,10 @@ def execute_subprocess_async(cmd, env=None, stdin=None, timeout=180, quiet=False
raise RuntimeError( raise RuntimeError(
f"'{cmd_str}' failed with returncode {result.returncode} - see the `stderr:` messages from above for details." f"'{cmd_str}' failed with returncode {result.returncode} - see the `stderr:` messages from above for details."
) )
if not result.stdout:
# check that the subprocess actually did run and produced some output, should the test rely on
# the remote side to do the testing
if not result.stdout and not result.stderr:
raise RuntimeError(f"'{cmd_str}' produced no output.") raise RuntimeError(f"'{cmd_str}' produced no output.")
return result return result
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment