From 8c3af71862cbe078a69feba2906cc6349c88c38b Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Fri, 2 Dec 2022 15:49:09 +0100 Subject: [PATCH] notify k8s system test: move sending message into exec The flake in #16076 is likely related to the notify message not being delivered/read correctly. Move sending the message into an exec session such that flakes will reveal an error message. Signed-off-by: Valentin Rothberg --- test/system/260-sdnotify.bats | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/system/260-sdnotify.bats b/test/system/260-sdnotify.bats index 970a2e3c7c..1fe1c66c72 100644 --- a/test/system/260-sdnotify.bats +++ b/test/system/260-sdnotify.bats @@ -268,6 +268,7 @@ metadata: labels: app: test name: test_pod + restartPolicy: "Never" annotations: io.containers.sdnotify: "container" io.containers.sdnotify/b: "conmon" @@ -276,7 +277,7 @@ spec: - command: - /bin/sh - -c - - 'printenv NOTIFY_SOCKET; echo READY; while ! test -f /stop;do sleep 0.1;done;systemd-notify --ready' + - 'printenv NOTIFY_SOCKET; while ! test -f /stop;do sleep 0.1;done' image: $_FEDORA name: a - command: @@ -332,6 +333,8 @@ ignore" run_podman logs $container_a is "${lines[0]}" "/run/notify/notify.sock" "NOTIFY_SOCKET is passed to container" + run_podman exec --env NOTIFY_SOCKET="/run/notify/notify.sock" $container_a /usr/bin/systemd-notify --ready + # Instruct the container to send the READY run_podman exec $container_a /bin/touch /stop @@ -339,6 +342,8 @@ ignore" main_pid="$output" run_podman container wait $container_a + run_podman container inspect $container_a --format "{{.State.ExitCode}}" + is "$output" "0" "container exited cleanly after sending READY message" wait_for_file $_SOCAT_LOG # The 'echo's help us debug failed runs run cat $_SOCAT_LOG