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

Unified Diff: appengine/components/tool_support/local_app.py

Issue 1373133004: Fixes and add smoke test: hard timeout on isolated task. (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: . Created 5 years, 3 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 | « no previous file | appengine/swarming/local_smoke_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/components/tool_support/local_app.py
diff --git a/appengine/components/tool_support/local_app.py b/appengine/components/tool_support/local_app.py
index bc1cd4dc2731e38fbdf230e1251c47a59b5afa79..e8b13ac60f796de7be0f31efaa6b9bbc78fdaaf9 100644
--- a/appengine/components/tool_support/local_app.py
+++ b/appengine/components/tool_support/local_app.py
@@ -181,7 +181,7 @@ class LocalApplication(object):
logging.info('Service %s is ready.', self.app_id)
self._serving = True
- def stop(self):
+ def stop(self, leak=False):
"""Stops dev_appserver, collects its log.
Returns the process error code if applicable.
@@ -206,11 +206,12 @@ class LocalApplication(object):
finally:
with open(os.path.join(self._temp_root, 'dev_appserver.log'), 'r') as f:
self._log = f.read()
- try:
- shutil.rmtree(self._temp_root)
- except OSError as e:
- # Log but ignore it to not mask other errors.
- print >> sys.stderr, str(e)
+ if not leak:
+ try:
+ shutil.rmtree(self._temp_root)
+ except OSError as e:
+ # Log but ignore it to not mask other errors.
+ print >> sys.stderr, str(e)
self._client = None
self._port = None
self._proc = None
« no previous file with comments | « no previous file | appengine/swarming/local_smoke_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698