summaryrefslogtreecommitdiff
path: root/buildscripts/task_generation
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-11 15:07:35 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-11 15:07:35 -0300
commit4cb8841196d0625dfa3825aa326f071cd27c7b8b (patch)
tree1682a647d4463397c119183369ae6f750d5fdcff /buildscripts/task_generation
parentaa03c6362cbaa767638e6eed9b031d86dd2643d1 (diff)
parent8f0827553e09872941945a093b647a4211a9db7f (diff)
Update upstream source from tag 'upstream/6.0.0'master
Update to upstream version '6.0.0' with Debian dir 5604a80ec1c96ca76f25f40d78e6ef855abec322
Diffstat (limited to 'buildscripts/task_generation')
-rw-r--r--buildscripts/task_generation/suite_split.py26
1 files changed, 18 insertions, 8 deletions
diff --git a/buildscripts/task_generation/suite_split.py b/buildscripts/task_generation/suite_split.py
index a65fcae68f0..5e1e9d32115 100644
--- a/buildscripts/task_generation/suite_split.py
+++ b/buildscripts/task_generation/suite_split.py
@@ -201,15 +201,25 @@ class SuiteSplitService:
if self.config.default_to_fallback:
return self.calculate_fallback_suites(params)
- evg_stats = HistoricTaskData.from_s3(self.config.evg_project, params.task_name,
- params.build_variant)
-
- if evg_stats:
+ try:
+ evg_stats = HistoricTaskData.from_evg(self.evg_api, self.config.evg_project,
+ self.config.start_date, self.config.end_date,
+ params.task_name, params.build_variant)
+ if not evg_stats:
+ LOGGER.debug("No test history, using fallback suites")
+ # This is probably a new suite, since there is no test history, just use the
+ # fallback values.
+ return self.calculate_fallback_suites(params)
return self.calculate_suites_from_evg_stats(evg_stats, params)
-
- LOGGER.debug("No test history, using fallback suites")
- # Since there is no test history this is probably a new suite, just use the fallback values.
- return self.calculate_fallback_suites(params)
+ except requests.HTTPError as err:
+ if err.response.status_code == requests.codes.SERVICE_UNAVAILABLE:
+ # Evergreen may return a 503 when the service is degraded.
+ # We fall back to splitting the tests into a fixed number of suites.
+ LOGGER.warning("Received 503 from Evergreen, "
+ "dividing the tests evenly among suites")
+ return self.calculate_fallback_suites(params)
+ else:
+ raise
def calculate_fallback_suites(self, params: SuiteSplitParameters) -> GeneratedSuite:
"""Divide tests into a fixed number of suites."""