Testing
-
TIL: pytest's xfail strict flag fails if the test unexpectedly passes
Marking a test @pytest.mark.xfail(strict=True) fails CI if the bug got fixed and nobody un-xfailed.
-
TIL: Go race detector can cause tests to pass that would fail in production
The race detector slows things down enough to hide some timing-dependent failures.
-
A workflow for flaky tests that doesn't involve retry-until-green
We stopped rerunning flakes and started investigating them. Our suite is healthier and faster for it.
-
httptest.Server is better than you think
Most Go HTTP tests I see are mocked when they should be using httptest.Server, and it shows
-
Benchmarking gotchas I learned the hard way
A collection of ways I made Go benchmarks lie to me, including the compiler optimizations I didn't know existed