feat(builder): add builder.run_timeout global build timeout#260
Merged
Conversation
Mirror runner.run_timeout for the build side: a builder.run_timeout config field (env BENCHMARKOOR_BUILDER_RUN_TIMEOUT) that caps the entire `benchmarkoor build` — all builders and targets — as a Go duration string. - BuilderConfig.RunTimeout + GetBuilderRunTimeout() (parses the duration, 0 when unset/invalid), the env-binding key, and validation in validateBuilder so an invalid value fails the build fast. - build.go wraps the build context in context.WithTimeout when set, the same pattern run.go uses for the runner timeout. - Tests, docs (env-var table + Builder section row), and a commented config.example.yaml entry.
From PR review: - When builder.run_timeout fires, wrap the bare "context deadline exceeded" as "build timed out (builder.run_timeout): ..." so the cause is clear (builds have no per-target status record, unlike the runner's timed_out). - Add TestLoad_BuilderRunTimeoutEnv guarding the BENCHMARKOOR_BUILDER_RUN_TIMEOUT env binding (the key is absent from the file), so a bindEnvKeys regression is caught.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
builder.run_timeoutconfig option — the build-side analogue of the existingrunner.run_timeout— that caps the entirebenchmarkoor build(all builders and targets). Requested to match the runner timeout.What
builder.run_timeout(Go duration string, e.g.2h; empty = no timeout), overridable viaBENCHMARKOOR_BUILDER_RUN_TIMEOUT.BuilderConfig.RunTimeout+GetBuilderRunTimeout()(parses the duration, returns 0 when unset/invalid — same semantics asGetRunnerRunTimeout).builder.run_timeoutenv-binding key so the env var is picked up even when absent from the file.validateBuilder(so an invalid value failsbenchmarkoor buildfast, with a clearinvalid builder.run_timeouterror).cmd/benchmarkoor/build.gowraps the build context incontext.WithTimeoutwhen set — the same patternrun.gouses for the runner timeout.Usage
or
BENCHMARKOOR_BUILDER_RUN_TIMEOUT=2h.Validation
go build ./...clean; golangci-lint--new-from-rev=origin/master0 issues.TestGetBuilderRunTimeout(table: nil/empty/valid/invalid) andTestValidateBuilder_RunTimeout; the env-var binding was also verified end-to-end via a tempLoadtest.run_timeoutrow under the## Buildersection, plus a commentedconfig.example.yamlentry.