Talk Python To Me cover image

Talk Python To Me

#429: Taming Flaky Tests

Sep 11, 2023
01:09:00
Snipd AI
Gregory Kapfhammer and Owain Parry discuss taming flaky tests in software development. They cover topics such as understanding flaky tests, common causes, handling test order dependencies, psychological impact of flaky tests on developers, and strategies for dealing with flaky tests.
Read more

Podcast summary created with Snipd AI

Quick takeaways

  • Flaky tests can introduce maintenance burdens and affect the reliability of the testing process, but tools like Datadog and Cypress offer flaky test management dashboards and insights to help developers troubleshoot and improve test reliability.
  • Unreliable and test order-dependent tests can undermine confidence in the testing process, but PyTest plugins like Hypothesis and Property-based tests, as well as plugins like Pytest Randomly and Pytest Picked, enable smarter test generations, reduced flakiness, and improved test ordering and selection.

Deep dives

Flaky tests and their impact on reliability

Flaky tests are test cases that pass or fail in a non-deterministic manner, even when the source code or test suite remains unchanged. The presence of flaky tests can be a challenge for developers as they can introduce maintenance burdens and affect the reliability of the testing process. Flakiness can arise due to various factors such as improper setup and teardown, shared resources, external system dependencies, and even the testing framework itself. Addressing flaky tests requires a balance between reducing flakiness and maintaining realistic and efficient tests. Tools like Datadog and Cypress offer flaky test management dashboards and insights to help developers better understand and troubleshoot flaky tests. Moreover, libraries like Tenacity and Pytest Randomly provide options for retrying tests with customized back-off strategies and randomized test ordering respectively. These tools and approaches aid in improving the overall reliability and effectiveness of the testing process.

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode