Skip to content

fix(test): remove docker redis test containers on exit - #206

Merged
akirilyuk merged 7 commits into
mainfrom
fix/test-redis-container-leak
Nov 20, 2026
Merged

akirilyuk merged 7 commits into
mainfrom
fix/test-redis-container-leak

Conversation

@akirilyuk

Copy link
Copy Markdown
Contributor

Agent tests leaked redis:7-alpine containers (about 3 per suite run, each with an anonymous volume), which filled the Docker VM disk and broke test/llm/knowledge-supabase-docker.test.ts.

Causes:

  • test/llm/knowledge-redis.test.ts closed the harness in an afterAll inside a describe.skipIf; a skipped describe never runs it, so the container stayed.
  • llm-agent-template and llm-language-tutor-template closed it only inside one test, so a skipped or failed test left it running.
  • A killed run (timeout, heavy-run kill) leaked it in every file.

Changes:

  • openTestRedis labels each docker container with the process pid, removes it on exit and on SIGINT/SIGTERM/SIGHUP, and on the next docker spawn removes only labelled containers whose pid is gone.
  • Top-level afterAll close in the three callers.
  • New test/test-redis-leak.test.ts (exit, SIGTERM, SIGKILL-then-next-spawn); skipped when docker is unavailable. It fails 3/3 without the helper change.

knowledge-supabase-docker.test.ts still fails on a full disk until the existing leaked containers are removed (not done here).

@akirilyuk
akirilyuk merged commit 1dd7b21 into main Nov 20, 2026
6 checks passed
@akirilyuk
akirilyuk deleted the fix/test-redis-container-leak branch November 20, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant