Ephemeral Environments Are Better for Scaling DevOps Tests
Quality is a top priority for every engineering leader, not just in terms of user experience and high availability but also faster turnaround while making developers’ lives easier. Instead of just verifying that all features and functions are working as expected, this means providing them with the right tools and resources to build and test applications efficiently.
You might resonate with this if you work in a fast-paced environment where things get created, released, and delivered frequently. It’s hard to test multiple things at a single point in time — juggling multiple features, bug fixes, and releases simultaneously makes thorough testing a real challenge. This, coupled with the complexity of managing parallel development and testing, also creates numerous challenges for continuous delivery.
This is where ephemeral environments come in. Ephemeral environments are essentially smaller versions or subsets of a working environment — production, pre-prod, or staging — where you can work in isolated environments to test and develop specific features or edge cases without impacting the shared environment.
In our Zoom interview, Shahid Ali Khan, Senior DevOps leader of the software testing platform LambdaTest, remarked how ephemeral test environments significantly help reduce this complexity and effort. “It used to be difficult to test multiple features at once. But now, because we can isolate tests, it’s easier to trace problems and identify the cause of issues in the code. This allows developers to work isolated, understanding how their changes affect the product’s behavior in different environments.”
But Is Adoption Challenging?
IT leaders may hesitate to use ephemeral environments due to their short-lived and minimal nature. And there are concerns about whether they’ll function similarly to production environments, especially at scale. But it’s important to remember that a replica is only sometimes necessary. Khan, who leads the DevOps engineering team at LambdaTest, shares from his experience building a scalable test execution platform, “We can gain confidence in the reliability of new features by testing specific use cases in the ephemeral environment, rather than the full process, and then promoting them to staging once we’re confident they won’t break anything.”
Because isolated environments provide a safe and controlled space for running tests and previewing features without affecting production systems. “By replicating the exact code in a production-like environment, you ensure the code is tested realistically. This helps identify and mitigate issues early in the development process, leading to a more stable and reliable application when deployed to production,” Khan explains. It makes perfect sense — say, if five developers contribute changes to a project, and one change accidentally breaks it, ephemeral environments can help isolate the problematic change, preventing delays and disruptions to the entire team.
Enterprises Want To Test at Scale With Flexibility
People want flexibility and scalability. They want to spin up customized environments with a few clicks, try out new features without friction, and scale their resources on demand. But generally speaking, creating/managing environments is painful work. Infrastructure-as-code tools like Terraform do help, but those tools do not always work well enough to help teams manage an arbitrary number of slightly different environments.
Kohsuke Kawaguchi, the creator of Jenkins, a thought leader and a leading expert in continuous integration and continuous delivery (CI/CD), points out, “Teams generally end up in a place where they have a fixed number of environments each designated for a specific use, including testing. Because a test environment becomes a shared resource, it inevitably leads to various problems. People who need to investigate test failures need to hold up all the other workloads; therefore, they only get limited time. And two tests running simultaneously could interfere with each other.”
When you make test environments ephemeral, these problems go away or at least can be reduced. Often, it takes a lot of work to make the whole thing ephemeral, but you can make pieces of it ephemeral, which can still give you all sorts of benefits. This, Kawaguchi affirms, “is particularly valuable in software testing, where teams can significantly improve their testing efficiency and scalability by leveraging ephemerality in areas like server-side deployments, browser testing grids, and device clouds.”
Containerizing Your Ephemeral Environments
Before containers became popular, virtual machines (VMs) were the standard for creating isolated environments. While tools like Vagrant and cloud providers offered easy access to VMs, these were often slow to start and consumed a lot of resources. Cloud-managed services simplified deployments with tools like AWS CloudFormation, but they came with potential vendor lock-in and cost concerns.
Serverless platforms like AWS Lambda are also an option for testing individual functions, but their limitations became apparent when dealing with complex applications and their intricate dependencies.
As a Technical Account Manager now at Splunk (a Cisco company), with over a decade of experience in cloud technologies and enterprise security, Sainag Nethala has seen how TestOps and DevOps practices have evolved, particularly with the astronomical rise of microservices and containerization.
Nethala advocates for containerizing ephemeral test environments. “There’s no better alternative,” he reasons. “Containers provide a high degree of isolation, preventing interference between different tests or environments. They are lightweight, faster, and can run on various devices and platforms. You can terminate them — like stopping those containers or spinning up new ones — anytime. Containers use fewer resources than virtual machines, making them perfect for quickly creating and destroying environments. Their portability also ensures consistency across different platforms, while their scalability allows for easy adjustments to match testing needs.”
Ephemeral environments are precious in this context, as they allow you to spin up tailored testing environments on demand and decommission them when they’re no longer needed.
Right-Sizing Your Performance Testing Environment
Mayank Bhola, CTO of LambdaTest, exposits the importance of accurately replicating production environments for performance testing. “It doesn’t need to be a replica of your production, but it should be able to reproduce the load your production is having. Otherwise, you will increase the infrastructure resources, which will increase cost,” he articulates. This means ensuring your test environment can handle the same amount of traffic and user load as production, optimizing resource allocation to avoid over-provisioning, and controlling cloud costs by using ephemeral environments that can be spun up and down as needed for performance testing.
While an exact mirror of your production environment might seem ideal, it’s often unnecessary and resource-intensive for most performance tests. Bhola suggests instead focusing on simulating the relevant aspects of production — the traffic patterns, user load, and data volumes that will realistically stress your application.
He underscores that this allows you to identify performance bottlenecks and optimize your application without the overhead of maintaining an identical copy of your production infrastructure. By accurately simulating production load, you can right-size your resources, avoid over-provisioning, and ultimately control cloud costs.
The Ephemeral Advantage
Fungible, ephemeral test environments make it easier to maintain test environment consistency. This eliminates contention for shared resources and allows for parallel testing without interference. Where readily applicable (e.g., server-side, browser, device cloud), this approach has been widely adopted. They’re cost-effective since they use fewer resources and configurations, and you can delete them with a single command when done, helping avoid unnecessary costs and speeding up the process.