9 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
Pinterest revamped its Android end-to-end testing by implementing a time-based sharding mechanism, which reduced build times by 36%. This new system balances the workload across testing shards, mitigating delays caused by slower tests. The switch to an in-house testing platform also improved reliability and developer efficiency.
If you do, here's more
Pinterest faced significant challenges with slow and unreliable Android end-to-end (E2E) testing builds in their continuous integration (CI) system. The primary issue stemmed from unbalanced test shards, where the entire build process was delayed by the slowest shard, often managed through Firebase Test Lab. To address this, Pinterest developed a time-based sharding mechanism within their in-house testing platform, PinTestLab, which utilizes historical test data to ensure each shard completes in roughly the same amount of time. This change led to a 36% reduction in overall build time, cutting 9 minutes off the process, and decreased the slowest shard's runtime by 55%.
The decision to build an in-house solution stemmed from a market evaluation of existing third-party options, which did not meet Pinterest's needs for reliable emulator support and low overhead. Conversations with peer companies and an internal proof-of-concept demonstrated the feasibility of creating their own Android testing platform, allowing greater control over the testing stack. The initial implementation involved using EC2-hosted emulators, transitioning from virtualized to bare-metal instances to overcome performance bottlenecks.
After launching PinTestLab's minimum viable product in December 2024, Pinterest shifted from package-based sharding to a more balanced approach. This new method assigns multiple emulators to each shard, running tests in a way that minimizes the variance in completion times. By focusing on equal wall-time rather than an equal number of tests per shard, Pinterest optimized resource utilization, leading to improved developer velocity and more reliable feedback in their CI process.
Questions about this article
No questions yet.