What the fixtures did
The test fixtures tore their container down with docker rm -f. Per the regression test’s own description, docker run creates an anonymous volume per container, and rm -f without -v leaves it behind. Nothing fails when that happens: the container is gone, the test is green, and the volume stays on disk.
The official documentation describes the flag that closes the gap: -v, –volumes means “Remove anonymous volumes associated with the container”.
What the commit message says
The commit message for the change quantifies the leak over one day of test runs. I am not repeating its figures here: the repository holds the message, not a captured measurement, so the article sticks to what the code shows. The same message says the change is test-only, with no production or ops code touched.
The change
The fixtures now remove the container together with its anonymous volumes through a shared helper in the voice suite’s conftest. A structural test checks that the cleanup finalizer is registered before docker network create runs, so a failure halfway through the setup still cleans up.
The regression test
The regression test starts a throw-away container from the same image the fixtures use, and asserts on the volume names of that container only, never on the host’s global volume count. Its negative control reproduces the old teardown: it removes a container with docker rm -f and asserts that the volume still exists. A second container goes through the helper, and the test asserts that its volume is gone while the first container’s volume is untouched.
A structural guard fails if a fixture file keeps the bare docker rm -f line. The commit message adds that the test was mutation-checked: reintroducing either defect makes it fail.
The lesson
Cleanup for ephemeral test infrastructure needs two things: remove the container with its anonymous volumes, and register that cleanup before creating the resources. Then write the regression test with a negative control, so it fails when the defect comes back.
Search the teardown of your Postgres fixtures for docker rm -f without -v.



