Skip to content

feat(builder): add builder.run_timeout global build timeout#260

Merged
skylenet merged 2 commits into
masterfrom
builder-timeout
Jul 3, 2026
Merged

feat(builder): add builder.run_timeout global build timeout#260
skylenet merged 2 commits into
masterfrom
builder-timeout

Conversation

@skylenet

@skylenet skylenet commented Jul 3, 2026

Copy link
Copy Markdown
Member

Adds a builder.run_timeout config option — the build-side analogue of the existing runner.run_timeout — that caps the entire benchmarkoor 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 via BENCHMARKOOR_BUILDER_RUN_TIMEOUT.
  • BuilderConfig.RunTimeout + GetBuilderRunTimeout() (parses the duration, returns 0 when unset/invalid — same semantics as GetRunnerRunTimeout).
  • Registered the builder.run_timeout env-binding key so the env var is picked up even when absent from the file.
  • Validation added to validateBuilder (so an invalid value fails benchmarkoor build fast, with a clear invalid builder.run_timeout error).
  • cmd/benchmarkoor/build.go wraps the build context in context.WithTimeout when set — the same pattern run.go uses for the runner timeout.

Usage

builder:
  run_timeout: 2h

or BENCHMARKOOR_BUILDER_RUN_TIMEOUT=2h.

Validation

  • go build ./... clean; golangci-lint --new-from-rev=origin/master 0 issues.
  • New tests: TestGetBuilderRunTimeout (table: nil/empty/valid/invalid) and TestValidateBuilder_RunTimeout; the env-var binding was also verified end-to-end via a temp Load test.
  • Docs: env-var table row + a run_timeout row under the ## Builder section, plus a commented config.example.yaml entry.

skylenet added 2 commits July 3, 2026 09:24
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.
@skylenet skylenet merged commit bc87014 into master Jul 3, 2026
7 checks passed
@skylenet skylenet deleted the builder-timeout branch July 3, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant