saucelabs / saucectl

A command line interface for the Sauce Labs platform.
Apache License 2.0
42 stars 16 forks source link

refactor: espresso sharding #957

Closed alexplischke closed 1 month ago

alexplischke commented 1 month ago

Description

Get rid of calculateJobsCount(), which was used to predict how many jobs are expected to launch.

The Problem

The prediction had to be always correct, lest you risk not all results being reported. This introduced unnecessary brittleness of ensuring that this business logic was accurate in two places: to predict and to actually launch this very amount.

The Solution

Create all StartOptions first, which represents the source of truth of how many jobs will be launched. Then queue them all up.

The reason why we can't simply do a go startJob() as we go, is because the jobs would be launching out of order, interfering with our launch order feature.