Skip to content

Commit

Permalink
Add retries to JDK matrix pipeline steps (#15877) (#15879)
Browse files Browse the repository at this point in the history
This commit adds retries to the steps of the Linux + Windows JDK matrix
pipeline steps to avoid notification noise due to transient network
errors.

(cherry picked from commit 3b747d8)

Co-authored-by: Dimitrios Liappis <[email protected]>
  • Loading branch information
github-actions[bot] and dliappis authored Jan 30, 2024
1 parent a44d4bf commit 6a1ed26
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .buildkite/scripts/jdk-matrix-tests/generate-steps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import abc
import copy
from dataclasses import dataclass, field
import os
import sys
Expand All @@ -7,6 +8,7 @@
from ruamel.yaml import YAML
from ruamel.yaml.scalarstring import LiteralScalarString

ENABLED_RETRIES = {"automatic": [{"limit": 3}]}

@dataclass
class JobRetValues:
Expand All @@ -15,6 +17,7 @@ class JobRetValues:
step_key: str
depends: str
agent: typing.Dict[typing.Any, typing.Any]
retry: typing.Optional[typing.Dict[typing.Any, typing.Any]] = None
artifact_paths: list = field(default_factory=list)


Expand Down Expand Up @@ -148,6 +151,7 @@ def unit_tests(self) -> JobRetValues:
depends=self.init_annotation_key,
artifact_paths=["build_reports.zip"],
agent=self.agent.to_dict(),
retry=copy.deepcopy(ENABLED_RETRIES),
)


Expand Down Expand Up @@ -219,6 +223,7 @@ def java_unit_test(self) -> JobRetValues:
step_key=step_key,
depends=self.init_annotation_key,
agent=self.agent.to_dict(),
retry=copy.deepcopy(ENABLED_RETRIES),
)

def ruby_unit_test(self) -> JobRetValues:
Expand All @@ -234,6 +239,7 @@ def ruby_unit_test(self) -> JobRetValues:
step_key=step_key,
depends=self.init_annotation_key,
agent=self.agent.to_dict(),
retry=copy.deepcopy(ENABLED_RETRIES),
)

def integration_tests_part_1(self) -> JobRetValues:
Expand All @@ -255,6 +261,7 @@ def integration_tests(self, part: int) -> JobRetValues:
step_key=step_key,
depends=self.init_annotation_key,
agent=self.agent.to_dict(),
retry=copy.deepcopy(ENABLED_RETRIES),
)

def pq_integration_tests_part_1(self) -> JobRetValues:
Expand All @@ -277,6 +284,7 @@ def pq_integration_tests(self, part: int) -> JobRetValues:
step_key=step_key,
depends=self.init_annotation_key,
agent=self.agent.to_dict(),
retry=copy.deepcopy(ENABLED_RETRIES),
)

def x_pack_unit_tests(self) -> JobRetValues:
Expand All @@ -292,6 +300,7 @@ def x_pack_unit_tests(self) -> JobRetValues:
step_key=step_key,
depends=self.init_annotation_key,
agent=self.agent.to_dict(),
retry=copy.deepcopy(ENABLED_RETRIES),
)

def x_pack_integration(self) -> JobRetValues:
Expand All @@ -307,6 +316,7 @@ def x_pack_integration(self) -> JobRetValues:
step_key=step_key,
depends=self.init_annotation_key,
agent=self.agent.to_dict(),
retry=copy.deepcopy(ENABLED_RETRIES),
)


Expand Down Expand Up @@ -361,6 +371,9 @@ def x_pack_integration(self) -> JobRetValues:
if job_values.artifact_paths:
step["artifact_paths"] = job_values.artifact_paths

if job_values.retry:
step["retry"] = job_values.retry

step["command"] = job_values.command

group_steps.append(step)
Expand Down

0 comments on commit 6a1ed26

Please sign in to comment.