Skip to content

[ci-fix] fix: add timeout to container runtime detection to prevent sonar system status from hanging#421

Draft
github-actions[bot] wants to merge 1 commit into
masterfrom
ci-fix/tool-detector-timeout-ef31ba6f0b79cd16
Draft

[ci-fix] fix: add timeout to container runtime detection to prevent sonar system status from hanging#421
github-actions[bot] wants to merge 1 commit into
masterfrom
ci-fix/tool-detector-timeout-ef31ba6f0b79cd16

Conversation

@github-actions

@github-actions github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Diagnosis

Category: Flaky / transient — test timeout caused by a missing subprocess timeout

The Integration and E2E Tests - linux job in Build run #27211240161 failed with a single test timeout:

(fail) system status > shows MCP configured when valid claude.json exists [15003.46ms]
  ^ this test timed out after 15000ms.

error: expect(received).toBe(expected)
Expected: 0
Received: 143   ← SIGTERM, process was killed by the test runner timeout

Root Cause

sonar system status calls checkMcpRunning()detectContainerRuntime(), which probes Docker/Podman/Nerdctl by running <runtime> info via spawnProcesswith no timeout.

On CI runners where Docker is installed but the daemon is slow or unresponsive, docker info hangs indefinitely. The test runner kills the sonar process after 15 s (exit code 143 = SIGTERM), which is why result.exitCode is 143 instead of 0.

spawnProcessWithTimeout already exists in src/lib/process.ts for exactly this purpose.

Fix

Replace spawnProcess with spawnProcessWithTimeout(runtime, ['info'], {}, 3000, ...) in isRuntimeAvailable. A 3-second cap is more than enough for a healthy daemon to respond and prevents the hang on sluggish CI runners.

File changed: src/lib/tool-detector.ts

Triggering failure

Generated by Ci Failure Triage Agent · sonnet46 3M ·

…Runtime

Without a timeout, docker/podman info can hang indefinitely when the
daemon is unresponsive, causing `sonar system status` to time out.
spawnProcessWithTimeout already exists for this purpose.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants