Skip to content

infra: just test-api leaks a Testcontainers postgres per test class (Ryuk not reaping) #826

Description

@radandevist

Problem: just test-api uses Testcontainers, which spins up a fresh postgres:18-alpine per test class, and Ryuk does not reap them — orphaned containers accumulate every run (observed: ~28 in a morning, ~57 more by afternoon, GBs of RAM + volumes). This degrades the dev machine, not just CI.

Safe manual prune (used during the loop): docker ps -aq --filter label=org.testcontainers=true → verify the dev DB (publyapp-postgres) and other-project containers are NOT in the set (they carry compose labels, not org.testcontainers) → docker rm -f those ids. Never a blanket label sweep.

Recommendation: Make Ryuk actually reap (check the Ryuk container/privileges in the test harness), or append a labelled prune (label=org.testcontainers=true) to the end of the test-api recipe.


Surfaced during the PR #806 review-fix loop; a standing repo/infra issue, not PR-specific.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendpr806-residueDeferred findings from the PR #806 review-fix loop; handled separatelytechnical-debt

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions