teardown

Removing or releasing everything that was set up for a piece of work, from a test's open connections to a whole temporary environment, once it is no longer needed.

In more detail

Teardown must also happen when something fails, which is why it belongs in cleanup code such as finally blocks or error handlers. Good teardown leaves nothing running that would keep a process alive, leak resources or keep costing money. For infrastructure, being able to tear an environment down and rebuild it from its description is what makes short-lived test environments safe and cheap.

Examples

In AWS: Deleting every resource an experiment or environment created, in the right order, so nothing keeps charging.
In Terraform: Reliable teardown is what makes short-lived environments safe and cheap. In Terraform it is terraform destroy, and it is the strongest proof that a configuration really describes the whole environment.

Related terms

Taught in

References