Reserve time from soft_deadline to upload traces if bot_update times out

The "upload traces" step is skipped if bot_update times out and is in
the grace_period. Reserve 1 minute to upload traces.

Bug: 1351547, 1456840
Change-Id: Idb191735a07d245575ff4c79375a976750522fa5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4651461
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
changes/61/4651461/10
Gavin Mak 2 years ago committed by LUCI CQ
parent 94761e3305
commit 60c4b8810b

@ -62,12 +62,12 @@ Recipe module to ensure a checkout is consistent on a bot.
Wrapper for easy calling of bot_update.
&mdash; **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#586)(self, bot_update_step):**
&mdash; **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#593)(self, bot_update_step):**
Deapplies a patch, taking care of DEPS and solution revisions properly.
&mdash; **def [ensure\_checkout](/recipes/recipe_modules/bot_update/api.py#123)(self, gclient_config=None, suffix=None, patch=True, update_presentation=True, patch_root=None, with_branch_heads=False, with_tags=False, no_fetch_tags=False, refs=None, clobber=False, root_solution_revision=None, gerrit_no_reset=False, gerrit_no_rebase_patch_ref=False, assert_one_gerrit_change=True, patch_refs=None, ignore_input_commit=False, add_blamelists=False, set_output_commit=False, step_test_data=None, enforce_fetch=False, download_topics=False, recipe_revision_overrides=None, \*\*kwargs):**
&mdash; **def [ensure\_checkout](/recipes/recipe_modules/bot_update/api.py#130)(self, gclient_config=None, suffix=None, patch=True, update_presentation=True, patch_root=None, with_branch_heads=False, with_tags=False, no_fetch_tags=False, refs=None, clobber=False, root_solution_revision=None, gerrit_no_reset=False, gerrit_no_rebase_patch_ref=False, assert_one_gerrit_change=True, patch_refs=None, ignore_input_commit=False, add_blamelists=False, set_output_commit=False, step_test_data=None, enforce_fetch=False, download_topics=False, recipe_revision_overrides=None, \*\*kwargs):**
Args:
* gclient_config: The gclient configuration to use when running bot_update.
@ -103,7 +103,7 @@ Args:
change's commit message to get this revision override requested by the
author.
&mdash; **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#563)(self, project_name, gclient_config=None):**
&mdash; **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#570)(self, project_name, gclient_config=None):**
Returns all property names used for storing the checked-out revision of
a given project.
@ -117,9 +117,9 @@ Args:
Returns (list of str): All properties that'll hold the checked-out revision
of the given project. An empty list if no such properties exist.
&emsp; **@property**<br>&mdash; **def [last\_returned\_properties](/recipes/recipe_modules/bot_update/api.py#34)(self):**
&emsp; **@property**<br>&mdash; **def [last\_returned\_properties](/recipes/recipe_modules/bot_update/api.py#41)(self):**
&mdash; **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#514)(self, bot_update_json, name):**
&mdash; **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#521)(self, bot_update_json, name):**
Sets a fixed revision for a single dependency using project revision
properties.

@ -25,7 +25,14 @@ class BotUpdateApi(recipe_api.RecipeApi):
bot_update_path = self.resource('bot_update.py')
kwargs.setdefault('infra_step', True)
with self.m.context(env=self._get_bot_update_env()):
# Reserve 1 minute to upload traces.
# TODO(gavinmak): Reserve from grace_period once https://crbug.com/1305422
# is fixed.
deadline = self.m.context.deadline
if deadline.soft_deadline: # pragma: no cover
deadline.soft_deadline -= 60
with self.m.context(env=self._get_bot_update_env(), deadline=deadline):
with self.m.depot_tools.on_path():
return self.m.step(name,
['vpython3', '-u', bot_update_path] + cmd,

Loading…
Cancel
Save