From 26f14c0888d8c466fd6a8d1f1abd946bcbb6aebc Mon Sep 17 00:00:00 2001 From: William Bezuidenhout Date: Tue, 13 Aug 2024 17:45:30 +0200 Subject: [PATCH] ci: set go mod tidy step timeout (#64449) Closes DINF-198 ## Test plan CI ``` { "label": ":bazel::broom: Go mod tidy", "key": "bazel-go-mod", "command": [ "./dev/ci/bazel-gomodtidy.sh" ], "timeout_in_minutes": "5", "retry": { "automatic": [ { "limit": 1, "exit_status": "*" }, { "limit": 1, "exit_status": -1 } ] }, "agents": { "queue": "aspect-small" } }, ``` ## Changelog --- dev/ci/internal/buildkite/buildkite.go | 7 +++++++ dev/ci/internal/ci/misc_operations.go | 2 ++ 2 files changed, 9 insertions(+) diff --git a/dev/ci/internal/buildkite/buildkite.go b/dev/ci/internal/buildkite/buildkite.go index 659c4c7230f..71547fe5abc 100644 --- a/dev/ci/internal/buildkite/buildkite.go +++ b/dev/ci/internal/buildkite/buildkite.go @@ -560,6 +560,13 @@ func AllowDependencyFailure() StepOpt { } } +// TimeoutInMinutes sets the timeout in minutes of the step to the given value +func TimeoutInMinutes(min int) StepOpt { + return func(step *Step) { + step.TimeoutInMinutes = fmt.Sprintf("%d", min) + } +} + // flattenStepOpts conveniently turns a list of StepOpt into a single StepOpt. // It is useful to build helpers that can then be used when defining operations, // when the helper wraps multiple stepOpts at once. diff --git a/dev/ci/internal/ci/misc_operations.go b/dev/ci/internal/ci/misc_operations.go index 136311b6772..c1955e4d936 100644 --- a/dev/ci/internal/ci/misc_operations.go +++ b/dev/ci/internal/ci/misc_operations.go @@ -26,6 +26,8 @@ func bazelGoModTidy() func(*bk.Pipeline) { bk.Agent("queue", AspectWorkflows.QueueSmall), bk.Key("bazel-go-mod"), bk.Cmd("./dev/ci/bazel-gomodtidy.sh"), + bk.AutomaticRetry(1), + bk.TimeoutInMinutes(5), } return func(pipeline *bk.Pipeline) {