mirror of
https://github.com/elastic/logstash.git
synced 2025-04-23 22:27:21 -04:00
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 3b747d86b8
)
Co-authored-by: Dimitrios Liappis <dimitrios.liappis@gmail.com>
This commit is contained in:
parent
d19de71456
commit
ff840751a9
1 changed files with 13 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
import abc
|
||||
import copy
|
||||
from dataclasses import dataclass, field
|
||||
import os
|
||||
import sys
|
||||
|
@ -7,6 +8,7 @@ import typing
|
|||
from ruamel.yaml import YAML
|
||||
from ruamel.yaml.scalarstring import LiteralScalarString
|
||||
|
||||
ENABLED_RETRIES = {"automatic": [{"limit": 3}]}
|
||||
|
||||
@dataclass
|
||||
class JobRetValues:
|
||||
|
@ -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)
|
||||
|
||||
|
||||
|
@ -148,6 +151,7 @@ class WindowsJobs(Jobs):
|
|||
depends=self.init_annotation_key,
|
||||
artifact_paths=["build_reports.zip"],
|
||||
agent=self.agent.to_dict(),
|
||||
retry=copy.deepcopy(ENABLED_RETRIES),
|
||||
)
|
||||
|
||||
|
||||
|
@ -219,6 +223,7 @@ ci/unit_tests.sh java
|
|||
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:
|
||||
|
@ -234,6 +239,7 @@ ci/unit_tests.sh ruby
|
|||
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:
|
||||
|
@ -255,6 +261,7 @@ ci/integration_tests.sh split {part-1}
|
|||
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:
|
||||
|
@ -277,6 +284,7 @@ ci/integration_tests.sh split {part-1}
|
|||
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:
|
||||
|
@ -292,6 +300,7 @@ x-pack/ci/unit_tests.sh
|
|||
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:
|
||||
|
@ -307,6 +316,7 @@ x-pack/ci/integration_tests.sh
|
|||
step_key=step_key,
|
||||
depends=self.init_annotation_key,
|
||||
agent=self.agent.to_dict(),
|
||||
retry=copy.deepcopy(ENABLED_RETRIES),
|
||||
)
|
||||
|
||||
|
||||
|
@ -361,6 +371,9 @@ if __name__ == "__main__":
|
|||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue