Timeout Configuration
The timeout parameter limits how long a pipeline can run before being automatically cancelled. This recipe shows how to set timeout values to prevent jobs from running indefinitely.
Complete YAML
Section titled “Complete YAML”name: Build with Timeoutplatform: iosenvironment: xcode: "16.4"
triggers: - push - pull_request
timeout: 30
steps: - name: Build run: fastlane buildTimeout Values
Section titled “Timeout Values”# 10 minutes (shortest reasonable timeout)timeout: 10
# 30 minutes (default for most iOS builds)timeout: 30
# 60 minutes (for slower builds)timeout: 60
# 120 minutes (for very large projects)timeout: 120Examples by Build Type
Section titled “Examples by Build Type”Quick Builds
Section titled “Quick Builds”name: Unit Testsplatform: iosenvironment: xcode: "16.4"
timeout: 15
triggers: - push - pull_request
steps: - name: Install pods run: pod install
- name: Run tests run: fastlane testStandard Builds
Section titled “Standard Builds”name: iOS Buildplatform: iosenvironment: xcode: "16.4"
timeout: 30
triggers: - push
steps: - name: Install gems run: bundle install
- name: Install pods run: pod install
- name: Build app run: fastlane buildLarge or Complex Builds
Section titled “Large or Complex Builds”name: Full Release Buildplatform: iosenvironment: xcode: "16.4"
timeout: 90
triggers: - push
steps: - name: Install gems run: bundle install
- name: Install pods run: pod install
- name: Run comprehensive tests run: fastlane test
- name: Build release run: fastlane build
- name: Deploy run: fastlane betaKey Points
Section titled “Key Points”- Timeout Unit: The
timeoutvalue is specified in minutes - Job Cancellation: When timeout is reached, the job is automatically cancelled and marked as failed
- No Partial Completion: If a step is running when timeout occurs, it’s terminated (no cleanup of partial artifacts)
- Default Behavior: If no timeout is specified, RunnerHub uses a platform-specific default (typically 60 minutes)
Timeout Strategy
Section titled “Timeout Strategy”Estimate Build Time
Section titled “Estimate Build Time”# Add 20% buffer to your typical build time# If builds usually take 25 min, set timeout to 30 mintimeout: 30Monitor and Adjust
Section titled “Monitor and Adjust”# Start conservative, increase if builds timeout# Week 1: timeout: 20# Week 2: After one timeout, increase to: timeout: 30Environment Variables
Section titled “Environment Variables”# For variable build times, use higher timeoutname: Conditional Buildplatform: iosenvironment: xcode: "16.4" variables: BUILD_TYPE: $BUILD_TYPE
triggers: - push
timeout: 45 # Accounts for slower days
steps: - name: Build run: fastlane buildHandling Timeouts
Section titled “Handling Timeouts”If your job times out:
- Review logs to identify slow steps
- Optimize dependencies — remove unused pods, gems, or packages
- Parallelize steps where possible (e.g., run tests in parallel)
- Increase timeout temporarily while optimizing
- Cache dependencies — leverage RunnerHub’s built-in caching
Slow Step Detection
Section titled “Slow Step Detection”name: Build with Timingplatform: iosenvironment: xcode: "16.4"
timeout: 40
steps: - name: Install gems run: | echo "Starting: $(date)" bundle install echo "Finished: $(date)"
- name: Install pods run: | echo "Starting pod install: $(date)" pod install echo "Finished pod install: $(date)"
- name: Build run: | echo "Starting build: $(date)" fastlane build echo "Finished build: $(date)"Best Practices
Section titled “Best Practices”- Set reasonable timeouts based on typical build duration
- Leave headroom — don’t set timeout equal to expected duration
- Monitor timeout failures in your CI/CD dashboard
- Optimize slow builds rather than extending timeouts
- Use separate timeouts for different pipeline types (tests vs. builds)