mirror of
https://github.com/agent-substrate/substrate.git
synced 2026-11-10 10:13:50 +08:00
I noticed my machine filling up with postgres containers ... --- First: storetest starts one PostgreSQL container per test binary in a sync.Once and never stops it, so every package that uses it leaks a container per run. Testcontainers' Ryuk reaper normally covers this, but it is not guaranteed to be running, and nothing else stops the container. Add Shutdown, plus a RunTests wrapper for packages whose TestMain does nothing else, and call it from the three packages that use storetest. atepg already terminates its own container this way. ---- Second: testcontainers does not respect docker contexts, making it difficult to use with [limactl](https://lima-vm.io/) etc. See: https://github.com/testcontainers/testcontainers-go/issues/2607 We automate the workaround to set the host env to point at the socket from the active docker context.