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

Unified Diff: client/run_isolated.py

Issue 1949613002: task_runner: always use run_isolated (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@master
Patch Set: rebased Created 4 years, 7 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 | « appengine/swarming/swarming_bot/bot_code/task_runner_test.py ('k') | client/utils/logging_utils.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 d1e253ad6d7a0cae461c009e89c0554fc32177e5..8883a8bc7d3128ccb92a7286bca5663d9bd5e8bb 100755
--- a/client/run_isolated.py
+++ b/client/run_isolated.py
@@ -144,6 +144,7 @@ def process_command(command, out_dir):
"""Replaces isolated specific variables in a command line."""
def fix(arg):
if ISOLATED_OUTDIR_PARAMETER in arg:
+ assert out_dir
arg = arg.replace(ISOLATED_OUTDIR_PARAMETER, out_dir)
# Replace slashes only if ISOLATED_OUTDIR_PARAMETER is present
# because of arguments like '${ISOLATED_OUTDIR}/foo/bar'
@@ -349,7 +350,7 @@ def map_and_run(
root_dir = os.path.dirname(cache.cache_dir) if cache.cache_dir else None
prefix = u'isolated_'
run_dir = make_temp_dir(prefix + u'run', root_dir)
- out_dir = make_temp_dir(prefix + u'out', root_dir)
+ out_dir = make_temp_dir(prefix + u'out', root_dir) if storage else None
tmp_dir = make_temp_dir(prefix + u'tmp', root_dir)
cwd = run_dir
@@ -431,13 +432,15 @@ def map_and_run(
result['exit_code'] = 1
# This deletes out_dir if leak_temp_dir is not set.
- result['outputs_ref'], success, result['stats']['upload'] = (
- delete_and_upload(storage, out_dir, leak_temp_dir))
+ if out_dir:
+ result['outputs_ref'], success, result['stats']['upload'] = (
+ delete_and_upload(storage, out_dir, leak_temp_dir))
if not success and result['exit_code'] == 0:
result['exit_code'] = 1
except Exception as e:
# Swallow any exception in the main finally clause.
- logging.exception('Leaking out_dir %s: %s', out_dir, e)
+ if out_dir:
+ logging.exception('Leaking out_dir %s: %s', out_dir, e)
result['internal_failure'] = str(e)
return result
« no previous file with comments | « appengine/swarming/swarming_bot/bot_code/task_runner_test.py ('k') | client/utils/logging_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698