[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
Draft
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Diagnosis
Category: Flaky / transient — test timeout caused by a missing subprocess timeout
The
Integration and E2E Tests - linuxjob in Build run #27211240161 failed with a single test timeout:Root Cause
sonar system statuscallscheckMcpRunning()→detectContainerRuntime(), which probes Docker/Podman/Nerdctl by running<runtime> infoviaspawnProcess— with no timeout.On CI runners where Docker is installed but the daemon is slow or unresponsive,
docker infohangs indefinitely. The test runner kills thesonarprocess after 15 s (exit code 143 = SIGTERM), which is whyresult.exitCodeis 143 instead of 0.spawnProcessWithTimeoutalready exists insrc/lib/process.tsfor exactly this purpose.Fix
Replace
spawnProcesswithspawnProcessWithTimeout(runtime, ['info'], {}, 3000, ...)inisRuntimeAvailable. 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.tsTriggering failure
9e881e84by tomshafir-sonarsource — "CLI-640 Align and reordersonar integrateinstall output"