Learn the difference between signal and noise when it comes to tests - it might not be what you expect! We'll walk through some examples of noisy passing tests, and noisy flakey tests, and talk about why retrying flakey tests will actually increase the noise in your tests.
- Define signal versus noise
- Describe how to handle test noise
- Show examples of passing tests:
- Test that passes (success + signal)
test_add_item_multiple
- Test that passes but shouldn’t (success but should fail)
test_get_most_recent
- Test that passes (success + signal)
- Fix the test that passes but shouldn't
- Show examples of failing tests:
- Failure that provides new information
test_submit_orders
(logic broken),test_get_total_orders
(test broken) - Failure that doesn’t provide new information (tests that are left broken, flakes)
- Failure that provides new information
- Fix the failing tests
- Describe flakey tests
- Show example of a flakey test
test_process_order
- Fix the flakey test
- Using retry on the entire function
@retry.retry(retries=3)
- Using retry on the connect function only
retry_network_errors(mrf.connect, retries=3)
- Update the connect function itself to backoff and retry (using backoff lib)
- Using retry on the entire function
- If extra time: explore some real life flakey tests