зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1667482 - [taskgraph] Don't fail if last backstop decision task is still running, r=marco
Differential Revision: https://phabricator.services.mozilla.com/D92096
This commit is contained in:
Родитель
210d2ba3ec
Коммит
f5e9969793
|
@ -66,6 +66,16 @@ def params():
|
||||||
True,
|
True,
|
||||||
id="no previous backstop",
|
id="no previous backstop",
|
||||||
),
|
),
|
||||||
|
pytest.param(
|
||||||
|
{
|
||||||
|
"index": DEFAULT_RESPONSES["index"],
|
||||||
|
"status": DEFAULT_RESPONSES["status"],
|
||||||
|
"artifact": {"status": 404},
|
||||||
|
},
|
||||||
|
{"pushlog_id": 1},
|
||||||
|
False,
|
||||||
|
id="previous backstop not finished",
|
||||||
|
),
|
||||||
pytest.param(
|
pytest.param(
|
||||||
DEFAULT_RESPONSES,
|
DEFAULT_RESPONSES,
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
from __future__ import absolute_import, print_function, unicode_literals
|
from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
|
from requests import HTTPError
|
||||||
|
|
||||||
from taskgraph.util.taskcluster import (
|
from taskgraph.util.taskcluster import (
|
||||||
find_task_id,
|
find_task_id,
|
||||||
get_artifact,
|
get_artifact,
|
||||||
|
@ -61,7 +63,17 @@ def is_backstop(
|
||||||
# If the last backstop failed its decision task, make this a backstop.
|
# If the last backstop failed its decision task, make this a backstop.
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
try:
|
||||||
last_pushdate = get_artifact(last_backstop_id, 'public/parameters.yml')["pushdate"]
|
last_pushdate = get_artifact(last_backstop_id, 'public/parameters.yml')["pushdate"]
|
||||||
|
except HTTPError as e:
|
||||||
|
# If the last backstop decision task exists in the index, but
|
||||||
|
# parameters.yml isn't available yet, it means the decision task is
|
||||||
|
# still running. If that's the case, we can be pretty sure the time
|
||||||
|
# component will not cause a backstop, so just return False.
|
||||||
|
if e.response.status_code == 404:
|
||||||
|
return False
|
||||||
|
raise
|
||||||
|
|
||||||
if (pushdate - last_pushdate) / 60 >= time_interval:
|
if (pushdate - last_pushdate) / 60 >= time_interval:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
Загрузка…
Ссылка в новой задаче