Skip to content

Scope TESTCONTAINERS_RYUK_DISABLED to Colima sockets only - #49

Merged
pikann merged 2 commits into
feature/implement-e2e-testsfrom
copilot/sub-pr-47-again
Mar 25, 2026
Merged

pikann merged 2 commits into
feature/implement-e2e-testsfrom
copilot/sub-pr-47-again

Conversation

Copilot AI commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

TESTCONTAINERS_RYUK_DISABLED=true was set unconditionally for every discovered Docker socket, disabling Ryuk globally and risking orphaned containers on test process kill/timeout.

Changes

  • isColimaSock(p string) bool — new helper that detects Colima-managed sockets by anchoring to $HOME/.colima/ (with /.colima/ substring fallback when home dir is unavailable)
  • checkDockerAvailable — Ryuk is now disabled only when the resolved socket is a Colima path; standard sockets (/var/run/docker.sock, ~/.docker/run/docker.sock, ~/.docker/desktop/docker.sock) leave Ryuk enabled
func isColimaSock(p string) bool {
    home, err := os.UserHomeDir()
    if err != nil {
        return strings.Contains(filepath.ToSlash(p), "/.colima/")
    }
    colimaDir := filepath.Join(home, ".colima") + string(filepath.Separator)
    return strings.HasPrefix(p, colimaDir)
}

Ryuk still fails for Colima because it attempts to mount the socket inside its own container — which breaks on the external macOS volume Colima uses — so the exemption is kept there. User-set TESTCONTAINERS_RYUK_DISABLED=true continues to be respected natively by testcontainers.


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Copilot AI changed the title [WIP] [WIP] Address feedback from review on e2e tests implementation Scope TESTCONTAINERS_RYUK_DISABLED to Colima sockets only Mar 25, 2026
Copilot AI requested a review from pikann March 25, 2026 08:13
@pikann
pikann marked this pull request as ready for review March 25, 2026 08:24
@pikann
pikann merged commit 5dfd804 into feature/implement-e2e-tests Mar 25, 2026
4 checks passed
@pikann
pikann deleted the copilot/sub-pr-47-again branch March 25, 2026 08:24
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.

2 participants