From 8ffe4e6c021ec791724fc323714647827b32d0c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 7 May 2026 14:28:24 +0200 Subject: [PATCH] tests: add journalctl diagnostics on containerd restart failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When restart_systemd_service_with_no_burst_limit fails or times out waiting for the containerd socket, emit "journalctl -xeu containerd.service" output so the failure reason is visible in CI logs without requiring a separate log-collection step. Signed-off-by: Fabiano FidĂȘncio Assisted-by: Cursor --- tests/common.bash | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/common.bash b/tests/common.bash index d601de041c..61e1af222c 100644 --- a/tests/common.bash +++ b/tests/common.bash @@ -441,11 +441,16 @@ function restart_systemd_service_with_no_burst_limit() { sudo systemctl daemon-reload fi - sudo systemctl restart "${service}" + sudo systemctl restart "${service}" || true local state state=$(systemctl show "${service}.service" -p SubState | cut -d'=' -f2) || true - [[ "${state}" == "running" ]] || { warn "Can't restart the ${service} service"; return 1; } + if [[ "${state}" != "running" ]]; then + warn "Can't restart the ${service} service (SubState=${state})" + warn "journalctl output for ${service}:" + sudo journalctl -xeu "${service}.service" --no-pager -n 50 || true + return 1 + fi start_burst=$(systemctl show "${service}.service" -p StartLimitBurst | cut -d'=' -f2) || true [[ "${start_burst}" -eq 0 ]] || { warn "Can't set start burst limit for ${service} service"; return 1; } @@ -464,7 +469,12 @@ function restart_containerd_service() { ((counter++)) done - [[ "${counter}" -ge "${retries}" ]] && { warn "Can't connect to containerd socket"; return 1; } + if [[ "${counter}" -ge "${retries}" ]]; then + warn "Can't connect to containerd socket after ${retries} retries" + warn "journalctl output for containerd:" + sudo journalctl -xeu containerd.service --no-pager -n 50 || true + return 1 + fi clean_env_ctr return 0