Skip to content

buildkite: add per-job timeouts and automatic retries#1586

Open
ViralBShah wants to merge 3 commits into
masterfrom
buildkite-retry-timeout
Open

buildkite: add per-job timeouts and automatic retries#1586
ViralBShah wants to merge 3 commits into
masterfrom
buildkite-retry-timeout

Conversation

@ViralBShah

Copy link
Copy Markdown
Member

Summary

  • Add timeout_in_minutes: 90 to all four Buildkite jobs so a hung test can't hold a shared agent indefinitely.
  • Add retry.automatic for exit_status: -1 and signal_reason: agent_stop (limit 2) so transient agent disconnects self-heal instead of turning PRs red.

Motivation

Recent dependabot PR #1585 went red because the macos-aarch64 agent dropped ~4 seconds into the job — a clear infra flake, not a test failure. With these settings Buildkite would have retried automatically and the PR would have stayed green. The timeout_in_minutes is defensive: today there's no upper bound on how long a stuck job can hold an agent.

Test plan

  • Confirm the four jobs still run on this PR's Buildkite build
  • Confirm the retry block parses and shows up in the Buildkite UI for each step

🤖 Generated with Claude Code

Adds timeout_in_minutes: 90 and retry.automatic for agent disconnects
and stops to all four jobs in .buildkite/runtests.yml. The retry block
self-heals transient agent failures (e.g. an agent dropping seconds
into a job) without requiring a manual rebuild. The timeout protects
shared agents from a hung test holding capacity indefinitely.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@DilumAluthge

Copy link
Copy Markdown
Member

Can you set a max number of retries? Otherwise in theory we can get caught in an infinite loop of retries.

@codecov

codecov Bot commented May 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.36%. Comparing base (d4f6a29) to head (0cf8326).
⚠️ Report is 44 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1586      +/-   ##
==========================================
- Coverage   94.37%   94.36%   -0.01%     
==========================================
  Files          35       35              
  Lines       15981    15981              
==========================================
- Hits        15082    15081       -1     
- Misses        899      900       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Lowers the per-condition retry limit from 2 to 1, so each job retries
at most twice total (once for an agent disconnect, once for an agent
stop). Bounds the worst-case retry budget tighter while still covering
the transient-flake case the retry block is meant to handle.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ViralBShah

Copy link
Copy Markdown
Member Author

Doesn't the limit do exactly that?

@DilumAluthge

Copy link
Copy Markdown
Member

Ah, I missed that, yes it does.

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.

2 participants