Slashing CI Wait Times: How Pinterest Cut Android Testing Build Times by 36%+
Read Full ArticleSummary
This article discusses Pinterest's approach to reducing CI wait times for Android end-to-end testing by implementing a runtime-aware sharding mechanism. The previous method of sharding tests by package names led to significant imbalances in execution times, causing delays due to the slowest shard. By leveraging historical test duration data, Pinterest developed a new in-house testing platform that optimally distributes tests across shards to ensure similar runtimes. The implementation resulted in a 36% reduction in build times and improved developer productivity by minimizing the impact of flaky tests and optimizing resource allocation on EC2-hosted emulators.
Key Learnings
- 1Implementing runtime-aware sharding can significantly reduce CI build times by balancing test execution across shards.
- 2Historical test duration data is crucial for optimizing test allocation and improving overall CI efficiency.
- 3Transitioning from third-party testing platforms to an in-house solution can provide better control over testing infrastructure and reduce flakiness.
- 4Utilizing a greedy algorithm for test assignment can lead to more predictable runtimes and improved resource utilization.
- 5Continuous monitoring and adjustment of the sharding algorithm based on performance metrics can further enhance developer experience.
Who Should Read This
Senior Software Engineers focusing on CI/CD optimization and test automation strategies
Test Your Knowledge
What are the trade-offs between using third-party testing platforms versus building an in-house solution for CI?
How does the runtime-aware sharding algorithm ensure balanced execution times across test shards?
What challenges did Pinterest face with their previous testing setup using Firebase Test Lab, and how were these addressed?
In what ways can historical test data be leveraged to improve CI/CD processes beyond just sharding?
What potential failure scenarios could arise from the new sharding mechanism, and how might they be mitigated?
Topics
More articles about Developer Experience
Explore Developer Experience engineering →Introducing Finish Changes and Outlines, now available in Gemini Code Assist extensions on IntelliJ and VS Code
The article introduces two new features in the Gemini Code Assist extensions for IntelliJ and Visual Studio Code: Finish Changes and Outlines. Finish Changes acts as an AI pair programmer, allowing...
Unleash Your Development Superpowers: Refining the Core Coding Experience
The article outlines recent feature enhancements in the Gemini Code Assist tool, designed to streamline the coding experience for developers. Key features include Agent Mode with Auto Approve for...
Introducing Wednesday Build Hour
The 'Wednesday Build Hour' is a weekly initiative designed for developers to engage in hands-on learning and skill enhancement in cloud technologies. Led by Google Cloud experts, the sessions cover a...
Get started with GitHub Copilot CLI: A free, hands-on course
The article introduces GitHub Copilot CLI, an AI-powered tool that enhances terminal workflows by allowing developers to interact with their code through natural language commands. It outlines a...
Building frontend UIs with Codex and Figma
The article introduces the Figma MCP server, a tool designed to enhance the workflow between design and code generation using Codex. It allows teams to seamlessly transfer design elements from Figma...
More from Pinterest Engineering
View Pinterest engineering blogs →Unified Context-Intent Embeddings for Scalable Text-to-SQL
The article outlines Pinterest's evolution from basic Text-to-SQL systems to a sophisticated Analytics Agent that leverages unified context-intent embeddings for enhanced query understanding and SQL...
Unifying Ads Engagement Modeling Across Pinterest Surfaces
The article presents a comprehensive approach to unify ads engagement modeling across different surfaces at Pinterest, addressing the challenges posed by previously independent models. It outlines...
Bridging the Gap: Diagnosing Online–Offline Discrepancy in Pinterest’s L1 Conversion Models
The article discusses the challenges faced by Pinterest in reconciling offline and online performance metrics of their L1 conversion models. It highlights the discrepancies observed between strong...
Piqama: Pinterest Quota Management Ecosystem
The article introduces Piqama, Pinterest's comprehensive quota management ecosystem designed to oversee resource quotas across various systems. It outlines the architecture of Piqama, emphasizing its...
Drastically Reducing Out-of-Memory Errors in Apache Spark at Pinterest
This article details Pinterest's approach to significantly reduce out-of-memory (OOM) errors in their Apache Spark applications through a feature called Auto Memory Retries. By automatically...