A job sometimes hangs and burns 6 hours. How do you stop it happening again?
BeginnerScenarioSpeed, Caching & Cost
Answer
Situation read → Default 360-minute timeout.
What I'd do →
- Set
timeout-minuteson every job based on p95 duration times 2 (for example 20). - Add step-level timeouts on network steps and tool timeouts (
kubectl rollout status --timeout=300s,curl --max-time 30). - Add an actionlint or custom check that fails PRs adding jobs without
timeout-minutes.
Why → A single hung job on a large runner can cost more than a week of normal CI.
Interview tip → Mention that timeouts also free up concurrency slots, not just money.
More on Speed, Caching & Cost
`npm ci` takes 4 minutes on every run. Fix it.BeginnerDocker builds take 12 minutes even when only one line of code changed. Speed them up.IntermediateThe repo hits the 10 GB cache limit daily and hit rates are poor. What do you change?IntermediatemacOS jobs are 60% of your bill. What are your options?IntermediateYour PR matrix is 3 OS times 4 versions (12 jobs). How do you cut cost without losing coverage?AdvancedTest suite takes 30 minutes on one runner. How do you parallelize it in Actions?Intermediate