---
title: "Test Budget: Time Constrained CI Feedback"
description: "Shopify's Test Infrastructure team evaluated a \"test budget\" for its 170,000-test Rails monolith: tests chosen by call-graph test selection are reordered with prioritization heuristics so failures surface early, and execution stops at a fixed time limit."
url: "https://swe.quest/articles/test-budget-time-constrained-ci-feedback-1e3be31297da77ec"
canonical: "https://shopify.engineering/test-budget-time-constrained-ci-feedback"
source: "Shopify Engineering"
published: "2022-03-07"
difficulty: "medium"
kind: "Research"
reading_minutes: 10
tags: ["testing","ci-cd","developer-productivity"]
---

# Test Budget: Time Constrained CI Feedback

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2022-03-07, 10 min read, Research. Original: [https://shopify.engineering/test-budget-time-constrained-ci-feedback](https://shopify.engineering/test-budget-time-constrained-ci-feedback)

## Summary

Shopify's Test Infrastructure team evaluated a "test budget" for its 170,000-test Rails monolith: tests chosen by call-graph test selection are reordered with prioritization heuristics so failures surface early, and execution stops at a fixed time limit. Six criteria (failure rate, average duration, churn, coverage, complexity, random) were compared using Time to First Failure, APFD and a Convergence Index. Historical failure rate performed best, finding 80% of failures after running 60% of the selected suite, while churn and complexity were nearly useless. The analysis suggests stopping at under 70% of the test-selection suite would still catch the first failure in most builds.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)
- [CI/CD](https://swe.quest/tags/ci-cd.md) (Reliability & operations)
- [Developer productivity](https://swe.quest/tags/developer-productivity.md) (Engineering practices)

## Prerequisites

- continuous integration pipelines ([easy posts on CI/CD](https://swe.quest/tags/ci-cd.md?difficulty=easy))
- test selection
- basic statistics (percentiles, boxplots)

## Keywords

Shopify, APFD, test prioritization, Redis Sorted Sets, Buildkite, Kafka

## Related posts

- [How we prepare Shopify for BFCM](https://swe.quest/articles/how-we-prepare-shopify-for-bfcm-4b4a641105e86a3e.md): Shopify Engineering · 2025-11-20 · Medium · 8 min read · Chaos engineering, Capacity planning, Scaling, SRE, E-commerce
  Shopify readies for Black Friday Cyber Monday with a year-long program that runs from March to October.
- [Performance Testing At Scale—for BFCM and Beyond](https://swe.quest/articles/performance-testing-at-scale-for-bfcm-and-beyond-2d2b72564f475785.md): Shopify Engineering · 2023-01-27 · Medium · 15 min read · Capacity planning, Performance engineering, Testing, Scaling, E-commerce
  Shopify prepares for Black Friday Cyber Monday by repeatedly running full-scale load tests against production: scaling Shopify Core and dependencies (nginx routing, ProxySQL, key/value store) to their BFCM profile, layering five Cronograma-driven traffic flows (browse/buy, admin, flash sale, Storefront API, Hydrogen/Oxygen) with an abort switch, then scaling down in reverse order and running blameless retrospectives.
- [Catching Bugs Before They Land: JiTTesting’s Human-on-the-Loop Approach at Full Scale](https://swe.quest/articles/catching-bugs-before-they-land-jittesting-s-human-on-the-loop-approach-at-full-5ed9a65800ed7e6c.md): Meta Engineering · 2026-10-29 · Medium · 6 min read · Testing, AI for coding, LLMs, Privacy
  Meta has moved Catching Just-in-Time Tests (JiTTests) from research prototype into production: LLMs generate executable tests designed to fail on risky diffs, exposing concrete behavioral changes before code lands rather than reviewing code like a human would.
- [Balancing Safety and Velocity in CI/CD at Slack](https://swe.quest/articles/balancing-safety-and-velocity-in-ci-cd-at-slack-cd559ba9ba4be498.md): Slack Engineering · 2022-02-18 · Medium · 12 min read · CI/CD, Testing, Developer productivity, Deployment
  Slack restructured CI for its Webapp monorepo from mostly pre-merge end-to-end testing into three tiers: a small pre-merge set (\<1% of e2e tests) that blocks merges, a post-merge set (\<10%) that blocks deploys, and a bi-hourly batched regression pipeline for low-criticality features.
- [Handling Flaky Tests at Scale: Auto Detection & Suppression](https://swe.quest/articles/handling-flaky-tests-at-scale-auto-detection-suppression-77980e444545e1fa.md): Slack Engineering · 2022-04-05 · Medium · 14 min read · Testing, CI/CD, Mobile, Developer productivity
  Slack's mobile DevXp team cut CI test job failures from 57% of failing builds to under 5% by automating flaky test detection and suppression across 27,000+ iOS and Android tests.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
