Unravel the complexities of high-fidelity testing in shared staging environments. The article sheds light on the hurdles faced by multiple teams sharing the same testing space and offers innovative solutions like staging locks, environment cloning, and the creation of ephemeral environments on-demand.
You know ‘Wi-Fi’ isn’t short for anything? It certainly sounds better than ‘IEEE 802.11b Direct Sequence,’ and it sounds similar to ‘Hi-Fi,’ which was at the time of its coining a popular term for a home stereo, and does have a meaning: high fidelity, the idea that the sound coming from your sound system closely resembled the original intent of the artist who made the music. That same design goal guides ‘High Fidelity Testing.’
High Fidelity Testing is a testing approach that involves testing on an environment that closely resembles the production environment. In general this testing refers to ‘acceptance testing,’ ‘integration testing,’ or ‘end-to-end tests.’ This method of testing is essential in ensuring that the product is tested under realistic conditions and that any bugs or issues are detected before the product is released. The concept is a design goal without a precise definition, since all testing will be in some way ‘faked’ and even a canary deploy can have code that will only fail at full scale.
To achieve High Fidelity Testing, it is necessary to create an environment that is as close to the production environment as possible. This includes using
All of these values add significant complexity over a basic local replication environment, and while most large teams have a high-fidelity shared staging environment, relying on this environment often finds multiple teams wanting to use this shared staging at the same time.
When first attempting to make a more accurate testing system, we end up with a shared environment (more on this in the next section). A shared environment is a natural starting place for better testing: things like production-like data and 3rd party integrations may not even be possible on local, atomized test environments, and it’s impractical to maintain a production-like configuration for every developer
In later sections we’ll discuss how to address the contention issue with shared staging envs.
By preventing commits for a while you prevent collision and incompatibilities during your testing window. There are many slack plugins for this exact task, showing how common the problem is.
Pros
Cons
In the end, as you can imagine, this does not scale as your team grows. It’s fine for small teams, especially those that have just grown out of a monolith stage
You can mitigate the contention by cloning staging envs. Often these clones will be large and logical, with who departments given their own clones to work on to avoid needless conflicts and lockouts.
Pros
Cons
Overall this is an expensive proposition. Moreover, this does not address the problem long term as you’ll still have contention and merge conflicts in these environments.
Several versions of ‘environments on demand’ exist currently. For example creating new envs per PR or for every dev in a Kubernetes namespace/vcluster.
Pros
Cons
The general goal of a more high-fidelity testing environment that doesn’t suffer frequent commit collision, is a design goal for every distributed microservice team. These different methods will all work at a particular scale and architecture. However, all three solutions described above have limits to how far they will scale.
While the three techniques above are used on many large teams, there’s one solution that’s less well-known and has the potential to improve scalability and the fidelity of testing.
This is the method employed at Signadot, and in use at large companies like Uber and Lyft, to allow large teams with complex architectures to still do high fidelity testing
Pros:
Cons:
A shared and well-maintained and updated staging environment is a key solution to make sure our tests closely resemble the real world where code will run. In order to prevent surprise failures when committing from Staging to production, it’s always worth the effort to enable high fidelity testing. However once we’ve created our amazing Staging environment, once our team scales up we will deal with contention over who has access to experiment on staging.
There are three well-known, and one a bit more novel, approaches to sharing a staging environment. All will work well at certain scales, and the request-based isolation approach will be well suited for growing engineering teams that are looking to scale testing without incurring a steep rise in infrastructure costs.
Get the latest updates from Signadot