Stop restarting your tests

This post details how Temporal's Durable Execution can be applied to orchestrate end-to-end test suites, specifically using Playwright as an example. It introduces the concept of treating each independent test execution (e.g., a specific spec file against a specific browser) as a Temporal Activity. This allows for individual retries of failed test executions without re-running the entire suite, preserving progress and reducing feedback loops in CI/CD pipelines. The implementation involves a wrapper around the existing test runner, where a Temporal Workflow fans out Activities to execute individual tests. Key technical aspects include the use of `Promise.allSettled` to ensure all executions reach a terminal state, the independent nature of Activities with their own retry policies, and the separation of test discovery from Workflow logic. The post emphasizes that Temporal does not fix flaky tests but provides a robust mechanism for handling their transient failures.