Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Unified Diff: client/run_isolated.py

Issue 1734743002: Do not consider missing command as internal failure. (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: . Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/isolateserver.py ('k') | client/tests/run_isolated_smoke_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/run_isolated.py
diff --git a/client/run_isolated.py b/client/run_isolated.py
index 3d0b18b50a62860b00832582a29d74014415d426..2eff0e09cfe3d09e928c318bb6132cbfa53dcdde 100755
--- a/client/run_isolated.py
+++ b/client/run_isolated.py
@@ -195,6 +195,15 @@ def run_command(command, cwd, tmp_dir, hard_timeout, grace_period):
except OSError:
# This is not considered to be an internal error. The executable simply
# does not exit.
+ sys.stderr.write(
+ '<The executable does not exist or a dependent library is missing>\n'
tandrii(chromium) 2016/02/24 18:45:59 does this "<" have a special meaning?
M-A Ruel 2016/02/24 19:03:14 No, I just wanted the output to look special.
+ '<Check for missing .so/.dll in the .isolate or GN file>\n'
+ '<Command: %s>\n' % command)
+ if os.environ.get('SWARMING_TASK_ID'):
+ # Give an additional hint when running as a swarming task.
+ sys.stderr.write(
+ '<See the task\'s page for commands to help diagnose this issue '
+ 'by reproducing the task locally>\n')
exit_code = 1
logging.info(
'Command finished with exit code %d (%s)',
@@ -271,12 +280,23 @@ def map_and_run(
out_dir = make_temp_dir(prefix + u'out', root_dir)
tmp_dir = make_temp_dir(prefix + u'tmp', root_dir)
try:
- bundle = isolateserver.fetch_isolated(
- isolated_hash=isolated_hash,
- storage=storage,
- cache=cache,
- outdir=run_dir,
- require_command=True)
+ try:
+ bundle = isolateserver.fetch_isolated(
+ isolated_hash=isolated_hash,
+ storage=storage,
+ cache=cache,
+ outdir=run_dir,
+ require_command=True)
+ except isolateserver.IsolatedErrorNoCommand:
+ # Handle this as a task failure, not an internal failure.
+ sys.stderr.write(
+ '<The .isolated doesn\'t declare any command to run!>\n'
+ '<Check your .isolate for missing \'command\' variable>\n')
+ if os.environ.get('SWARMING_TASK_ID'):
+ # Give an additional hint when running as a swarming task.
+ sys.stderr.write('<This occurs at the \'isolate\' step\n')
tandrii(chromium) 2016/02/24 18:45:59 missing '>' before \n
M-A Ruel 2016/02/24 19:03:14 Done.
+ result['exit_code'] = 1
+ return result
change_tree_read_only(run_dir, bundle.read_only)
cwd = os.path.normpath(os.path.join(run_dir, bundle.relative_cwd))
« no previous file with comments | « client/isolateserver.py ('k') | client/tests/run_isolated_smoke_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698